It appears that around the time that I upgraded rails to 3.2.8, the body isn't being set when I create and send emails. No code around the mailers has changed in this time, with the exception of ActionMailer also upgrading to 3.2.8.
I have beta_request_mailer.rb
in app/mailers
with the following method:
def beta_request(request)
mail(
:to => "#{request[:name]} <#{request[:email]}>",
:subject => 'Thanks for requesting an invite to xxxxx!'
)
end
I also have a body file which worked fine: app/views/beta_request_mailer/beta_request_email.html.erb
The email is being sent fine, just without any body. Running in the console, the mail object that's created in beta_request has no body when running mail.body
. If I set a body manually, that gets sent out.
What's changed that I'm not aware of?
I was also getting emails that arrived ok and with the correct subject, but with no content in the mail and found that using the .deliver! instead of just .deliver method cured the problem (though don't know why)
Fixed by removing _email from file name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With