Class: MassMandrill::MandrillMailer

Inherits:
Object
  • Object
show all
Defined in:
lib/mass_mandrill/mandrill_mailer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_name) ⇒ MandrillMailer

Returns a new instance of MandrillMailer.



5
6
7
# File 'lib/mass_mandrill/mandrill_mailer.rb', line 5

def initialize(template_name)
  @template_name = template_name
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/mass_mandrill/mandrill_mailer.rb', line 3

def message
  @message
end

Class Method Details

.method_missing(method_name, *args) ⇒ Object



9
10
11
# File 'lib/mass_mandrill/mandrill_mailer.rb', line 9

def self.method_missing(method_name, *args)
  new(method_name).send(method_name, *args)
end

Instance Method Details

#mail(options) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/mass_mandrill/mandrill_mailer.rb', line 13

def mail(options)
  @message = build_message(options)
  @template_content = []
  @template_name = options[:template] if options[:template]

  MandrillMail.new(@template_name, @template_content, @message)
end