diff options
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 9aae14ec8c..fc2d0936f9 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -138,9 +138,20 @@ module ActionMailer # Once a mailer action and template are defined, you can deliver your message or create it and save it # for delivery later: # - # Notifier.welcome(david).deliver # sends the email - # mail = Notifier.welcome(david) # => a Mail::Message object - # mail.deliver # sends the email + # Notifier.welcome(david).deliver_now # sends the email + # mail = Notifier.welcome(david) # => an ActionMailer::MessageDeliver object + # mail.deliver_now # sends the email + # + # The <tt>ActionMailer::MessageDeliver</tt> class is a wrapper around a <tt>Mail::Message</tt> object. If + # you want direct access to the <tt>Mail::Message</tt> object you can call the <tt>message</tt> method on + # the <tt>ActionMailer::MessageDeliver</tt> object. + # + # Notifier.welcome(david).message # => a Mail::Message object + # + # ActionMailer is nicely integrated with ActiveJob so you can send emails in the background (example: outside + # of the request-response cycle, so the user doesn't have to wait on it): + # + # Notifier.welcome(david).deliver_later # enqueue the email sending to ActiveJob # # You never instantiate your mailer class. Rather, you just call the method you defined on the class itself. # @@ -322,8 +333,8 @@ module ActionMailer # end # # Methods must return a <tt>Mail::Message</tt> object which can be generated by calling the mailer - # method without the additional <tt>deliver</tt>. The location of the mailer previews - # directory can be configured using the <tt>preview_path</tt> option which has a default + # method without the additional <tt>deliver_now</tt> / <tt>deliver_later</tt>. The location of the + # mailer previews directory can be configured using the <tt>preview_path</tt> option which has a default # of <tt>test/mailers/previews</tt>: # # config.action_mailer.preview_path = "#{Rails.root}/lib/mailer_previews" |