You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have rails-api application, i want to send welcome email to the customer.
I have a method called send_welcome_email in customer_mailer.rb
def send_welcome_email(user)
email = "noreply@getsavvy.in"
mail(to:"#{user.email}", from:email ,subject:"Thanks for signing up")
end
and in customer.rb iam calling
def send_welcome_mail
CustomerMailer.send_welcome_email(self).deliver_now
end
I also have an send_welcome_email.html.erb template in app/views/customer_mailer/
I am getting following error
CustomerMailer#send_welcome_email: processed outbound mail in 77.7ms
ActionView::MissingTemplate: Missing template customer_mailer/send_welcome_email with "mailer". Searched in:
"customer_mailer"
Any idea what am I doing wrong here?
The text was updated successfully, but these errors were encountered:
I generated a clean new app using rails 4.2.7 and rails-api. This has pointed me to these problems with my main app that I was developing:
Layout Files
I had the same problem with missing templates being reported and then saw that with a normal rails 4.2.7 application two more files are created with any bin/rails g mailer call:
app/views/layouts/mailer.text.erb
app/views/layouts/mailer.html.erb
if you copy over or otherwise generate those files, suddenly the templates are found.
mailer.text.erb content:
<%= yield %>
mailer.html.erb content:
<html>
<body>
<%= yield %>
</body>
</html>
Spring
Issues #23 and #147 suggest disabling spring. At the time of this writing this can be done in two steps:
I have rails-api application, i want to send welcome email to the customer.
I have a method called send_welcome_email in customer_mailer.rb
and in customer.rb iam calling
I also have an send_welcome_email.html.erb template in app/views/customer_mailer/
I am getting following error
CustomerMailer#send_welcome_email: processed outbound mail in 77.7ms
ActionView::MissingTemplate: Missing template customer_mailer/send_welcome_email with "mailer". Searched in:
Any idea what am I doing wrong here?
The text was updated successfully, but these errors were encountered: