2016-08-26 21 views
7

私はSidekiqを使用して電子メールを非同期配信していますが、電子メールテンプレートを見つけることができないという永続的なエラーがありました。それは時々(私がテストしているときのように)動作するので一貫していません。私はテンプレートのパスと名前を指定しようとしたことがわかりました。ActionView :: MissingTemplate: "mailer"を含むsignup_mailer/welcome_messageテンプレートがありません。 * "signup_mailer"

私はHoneybadgerで受け付けておりますエラーは次のとおりです。ActionView::MissingTemplate: Missing template signup_mailer/welcome_message with "mailer". Searched in: * "signup_mailer"あなたはwelcome_message.html.erbというビューと同様app/views/signup_mailer/にあるテキスト版が実際に存在していることを写真で見ることができます

app/mailers/signup_mailer.rb

class SignupMailer < ActionMailer::Base 
    default from: '[email protected]' 

    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 

enter image description here

+0

変更subject: 'Welcome to CompanyCam') ' – VKatz

+0

これは私が元々持っていたものですが、それでも動作しませんでした。だから私は手動で情報を設定しようとしました。 – CWitty

+0

潜在的な解決策[ここ](http://stackoverflow.com/questions/30984400/mailer-error-missing-template)があなたのために働いていますか? – AbM

答えて

0

これを試すことができますか? company.email @、:へのメールに=>(( 'WELCOME_MESSAGE':company.email @、件名:、template_path 'CompanyCamへようこそ': 'signup_mailer' テンプレート名まで)メール `から

class SignupMailer < ActionMailer::Base 
    default from: '[email protected]' 
    layout "welcome_message" 

    def welcome_message(company, user) 
    @company = company 
    @user = user 
    @web_url = root_url 
    mail(to: @company.email, subject: 'Welcome to CompanyCam') 
    end 
end 
関連する問題