I am using "Action Mailer" in Ruby on Rails application to send emails. I have the following action mailer:
class SecurityUserMailer < ActionMailer::Base
default from: '[email protected]'
def password_reset(security_user)
@security_user = security_user
mail to: security_user.email, subject: 'Password Reset'
end
def email_confirmation(security_user)
@security_user = security_user
mail to: security_user.email, subject: 'Account Created'
end
end
I am successfully sending emails but the second method (email_confirmation) is not using the corresponding template.
The email templates are in views/security_users_mailer folder and named as follows:
Why only the password_reset template is used?
Note, firstly, I thought that maybe there is something wrong with the code in my template but then I replace it with text content and it is not rendered again.
Rails 4 I had this same issue, but mine was caused by having an empty layout in layouts/mailer.html.erb
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