Hello,
I have problem with ActionMailer, when I try to execute action:
rake send_email
I get a error:
class UserMailer < ActionMailer::Base
default from: "from@example.com"
layout "mailer"
def mailer(user)
@user = user
mail(to: @user.email, subject: 'Test')
end
end
Add a html layout under layout#
mailer.html.erb
<%= yield %>
Add text layout under layout #
mailer.text.erb
<%= yield %>
Use preview to check your email based on your test framework.