Generating a new mailer

suggest change

To generate a new mailer, enter the following command

rails generate mailer PostMailer

This generates the mailer class app/mailers/post_mailer.rb:

class PostMailer < ApplicationMailer
end

It also generates HTML and text mailer layouts. Action templates go in app/views/post_mailer/, and only when you pass action names to the generator. rails generate mailer PostMailer with no actions does not create those templates.

If you prefer not to use the generator, you can create your own mailers. Inherit from ApplicationMailer, which inherits from ActionMailer::Base.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents