Ruby on Rails - generating a new mailer in ruby on rails- ruby on rails tutorial - rails guides - rails tutorial - ruby rails
How to generate a new mailer
Enter the given below command to generate newmailer.
This will generate a blank template file in app/mailers/post_mailer.rb named PostMailer
- Two layout files will also be generated for the email view, one for the html format and one for the text format.
- If we prefer not to use the generator, we can create our own mailers. Make sure they inherit from ActionMailer::Basefiles: