Class: HttpMailer::MandrillMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/http_mailer/mandrill/mandrill_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to, subject, text = nil, html = nil, from_name = nil, to_name = nil) ⇒ MandrillMessage

Returns a new instance of MandrillMessage.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 6

def initialize(from, to, subject, text=nil, html=nil, from_name=nil, to_name=nil)
  @to = to
  @from = from
  @subject = subject
  @text = text
  @html = html
  @to_name = to_name
  @from_name = from_name
  @structure = json_message_struct
  build_message
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 3

def from
  @from
end

#from_nameObject

Returns the value of attribute from_name.



3
4
5
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 3

def from_name
  @from_name
end

#htmlObject

Returns the value of attribute html.



3
4
5
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 3

def html
  @html
end

#structureObject (readonly)

Returns the value of attribute structure.



4
5
6
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 4

def structure
  @structure
end

#subjectObject

Returns the value of attribute subject.



3
4
5
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 3

def subject
  @subject
end

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 3

def text
  @text
end

#toObject

Returns the value of attribute to.



3
4
5
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 3

def to
  @to
end

#to_nameObject

Returns the value of attribute to_name.



3
4
5
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 3

def to_name
  @to_name
end

Instance Method Details

#to_hObject



18
19
20
# File 'lib/http_mailer/mandrill/mandrill_message.rb', line 18

def to_h
  self.structure.to_h
end