加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – ActionView :: MissingTemplate:缺少模板sign

发布时间:2020-12-17 04:13:31 所属栏目:百科 来源:网络整理
导读:我正在使用Sidekiq以异步方式发送我的电子邮件,但是由于无法找到电子邮件模板而遇到了持续性错误.它不一致,因为它不时工作(就像我正在测试时).您可以看到我甚至尝试指定模板的路径和名称. 我在Honeybadger中收到的错误是:ActionView :: MissingTemplate:缺
我正在使用Sidekiq以异步方式发送我的电子邮件,但是由于无法找到电子邮件模板而遇到了持续性错误.它不一致,因为它不时工作(就像我正在测试时).您可以看到我甚至尝试指定模板的路径和名称.

我在Honeybadger中收到的错误是:ActionView :: MissingTemplate:缺少模板signup_mailer / welcome_message with“mailer”.搜索:*“signup_mailer”

应用程序/邮寄者/ signup_mailer.rb

class SignupMailer < ActionMailer::Base
  default from: 'hello@companycam.com'

  def welcome_message(company,user)
    @company = company
    @user = user
    @web_url = root_url
    mail(to: @company.email,subject: 'Welcome to CompanyCam',template_path: 'signup_mailer',template_name: 'welcome_message')
  end
end

您可以在图片中看到实际上有一个名为welcome_message.html.erb的视图以及位于app / views / signup_mailer /中的文本版本

解决方法

你能试一试吗?
class SignupMailer < ActionMailer::Base
  default from: 'hello@companycam.com' 
  layout "welcome_message"

  def welcome_message(company,subject: 'Welcome to CompanyCam')
  end
end

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读