Mailer error missing template

后端 未结 8 1019
谎友^
谎友^ 2021-02-18 21:25

Hello,

I have problem with ActionMailer, when I try to execute action:

rake send_email

I get a error:



        
8条回答
  •  囚心锁ツ
    2021-02-18 22:07

    Try adding layout

    class UserMailer < ActionMailer::Base
      default from: "from@example.com"
    
      layout "mailer"
    
      def mailer(user)
       @user = user
       mail(to: @user.email, subject: 'Test')
     end
    
    end
    

提交回复
热议问题