Class: MandrillMailer::MessageMailer

Inherits:
CoreMailer show all
Defined in:
lib/mandrill_mailer/offline.rb,
lib/mandrill_mailer/message_mailer.rb

Instance Attribute Summary

Attributes inherited from CoreMailer

#async, #ip_pool, #message, #send_at

Instance Method Summary collapse

Methods inherited from CoreMailer

#bcc, default, #from, #mandrill_mail, #mandrill_mail_handler, super_defaults, test, test_setup_for, #to, #to=

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MandrillMailer::CoreMailer

Instance Method Details

#deliverObject

Public: Triggers the stored Mandrill params to be sent to the Mandrill api



99
100
101
# File 'lib/mandrill_mailer/message_mailer.rb', line 99

def deliver
  deliver_now
end

#deliver_later(options = {}) ⇒ Object



107
108
109
# File 'lib/mandrill_mailer/message_mailer.rb', line 107

def deliver_later(options={})
  MandrillMailer::MandrillMessageJob.set(options).perform_later(message, async, ip_pool, send_at, self.class.name)
end

#deliver_nowObject



44
45
46
47
48
49
50
51
52
53
# File 'lib/mandrill_mailer/offline.rb', line 44

def deliver_now
  MandrillMailer::Mock.new({
    :message          => message,
    :async            => async,
    :ip_pool          => ip_pool,
    :send_at          => send_at
  }).tap do |mock|
     MandrillMailer.deliveries << mock
  end
end