Class: MandrillBatchMailer::BaseMailer

Inherits:
Object
  • Object
show all
Defined in:
lib/mandrill_batch_mailer/base_mailer.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method) ⇒ BaseMailer

Returns a new instance of BaseMailer.



14
15
16
# File 'lib/mandrill_batch_mailer/base_mailer.rb', line 14

def initialize(method)
  self.caller_method_name = method
end

Class Method Details

.method_missing(method, *args) ⇒ Object

do it just as ActionMailer



40
41
42
43
44
45
46
47
# File 'lib/mandrill_batch_mailer/base_mailer.rb', line 40

def method_missing(method, *args)
  mailer = new method
  if mailer.respond_to? method
    mailer.public_send(method, *args)
  else
    super method, *args
  end
end

Instance Method Details

#from_emailObject

feel free to override



24
25
26
# File 'lib/mandrill_batch_mailer/base_mailer.rb', line 24

def from_email
  MandrillBatchMailer.from_email
end

#from_nameObject

feel free to override



29
30
31
# File 'lib/mandrill_batch_mailer/base_mailer.rb', line 29

def from_name
  MandrillBatchMailer.from_name || ''
end

#mail(to: nil) ⇒ Object



18
19
20
21
# File 'lib/mandrill_batch_mailer/base_mailer.rb', line 18

def mail(to: nil)
  @tos = tos_from(to)
  send_template mandrill_parameters
end

#tagsObject

feel free to override



34
35
36
# File 'lib/mandrill_batch_mailer/base_mailer.rb', line 34

def tags
  ["#{template_name}"]
end