ruby-on-rails – ActionView :: MissingTemplate:缺少模板signup_mailer / welcome_message with“mailer”.搜索:*“signup_mailer”

我正在使用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

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...