diff options
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 8 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/message_delivery.rb | 24 |
2 files changed, 16 insertions, 16 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 0e4497536d..ad3aebbe9b 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -138,20 +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_now # sends the email - # mail = Notifier.welcome('david') # => an ActionMailer::MessageDeliver object + # Notifier.welcome(User.first).deliver_now # sends the email + # mail = Notifier.welcome(User.first) # => 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 + # Notifier.welcome(User.first).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 + # Notifier.welcome(User.first).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. # diff --git a/actionmailer/lib/action_mailer/message_delivery.rb b/actionmailer/lib/action_mailer/message_delivery.rb index 6b326719de..db7724195c 100644 --- a/actionmailer/lib/action_mailer/message_delivery.rb +++ b/actionmailer/lib/action_mailer/message_delivery.rb @@ -7,10 +7,10 @@ module ActionMailer # around a lazy created Mail::Message. You can get direct access to the # Mail::Message, deliver the email or schedule the email to be sent through ActiveJob. # - # Notifier.welcome('david') # an ActionMailer::MessageDeliver object - # Notifier.welcome('david').deliver_now # sends the email - # Notifier.welcome('david').deliver_later # enqueue the deliver email job to ActiveJob - # Notifier.welcome('david').message # a Mail::Message object + # Notifier.welcome(User.first) # an ActionMailer::MessageDeliver object + # Notifier.welcome(User.first).deliver_now # sends the email + # Notifier.welcome(User.first).deliver_later # enqueue the deliver email job to ActiveJob + # Notifier.welcome(User.first).message # a Mail::Message object class MessageDelivery < Delegator def initialize(mailer, mail_method, *args) #:nodoc: @mailer = mailer @@ -38,9 +38,9 @@ module ActionMailer # # ==== Examples # - # Notifier.welcome('david').deliver_later - # Notifier.welcome('david').deliver_later(in: 1.hour) - # Notifier.welcome('david').deliver_later(at: 10.hours.from_now) + # Notifier.welcome(User.first).deliver_later + # Notifier.welcome(User.first).deliver_later(in: 1.hour) + # Notifier.welcome(User.first).deliver_later(at: 10.hours.from_now) # # ==== Options # * <tt>in</tt> - Enqueue the message to be delivered with a delay @@ -54,9 +54,9 @@ module ActionMailer # # ==== Examples # - # Notifier.welcome('david').deliver_later - # Notifier.welcome('david').deliver_later(in: 1.hour) - # Notifier.welcome('david').deliver_later(at: 10.hours.from_now) + # Notifier.welcome(User.first).deliver_later + # Notifier.welcome(User.first).deliver_later(in: 1.hour) + # Notifier.welcome(User.first).deliver_later(at: 10.hours.from_now) # # ==== Options # * <tt>in</tt> - Enqueue the message to be delivered with a delay @@ -68,7 +68,7 @@ module ActionMailer # Delivers a message. The message will be sent bypassing checking perform_deliveries # and raise_delivery_errors, so use with caution. # - # Notifier.welcome('david').deliver_now! + # Notifier.welcome(User.first).deliver_now! # def deliver_now! message.deliver! @@ -76,7 +76,7 @@ module ActionMailer # Delivers a message: # - # Notifier.welcome('david').deliver_now + # Notifier.welcome(User.first).deliver_now # def deliver_now message.deliver |