Class: Griddler::Email

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::SanitizeHelper
Defined in:
lib/griddler/email.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Email

Returns a new instance of Email.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/griddler/email.rb', line 9

def initialize(params)
  @params = params

  @to = extract_address(params[:to], config.to)
  @from = extract_address(params[:from], :email)
  @subject = params[:subject]

  @body = extract_body
  @raw_body = params[:text] || params[:html]

  @headers = extract_headers
  @raw_headers = params[:headers]

  @attachments = params[:attachments]
end

Instance Attribute Details

#attachmentsObject (readonly)

Returns the value of attribute attachments.



6
7
8
# File 'lib/griddler/email.rb', line 6

def attachments
  @attachments
end

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/griddler/email.rb', line 6

def body
  @body
end

#fromObject (readonly)

Returns the value of attribute from.



6
7
8
# File 'lib/griddler/email.rb', line 6

def from
  @from
end

#headersObject (readonly)

Returns the value of attribute headers.



6
7
8
# File 'lib/griddler/email.rb', line 6

def headers
  @headers
end

#raw_bodyObject (readonly)

Returns the value of attribute raw_body.



6
7
8
# File 'lib/griddler/email.rb', line 6

def raw_body
  @raw_body
end

#raw_headersObject (readonly)

Returns the value of attribute raw_headers.



6
7
8
# File 'lib/griddler/email.rb', line 6

def raw_headers
  @raw_headers
end

#subjectObject (readonly)

Returns the value of attribute subject.



6
7
8
# File 'lib/griddler/email.rb', line 6

def subject
  @subject
end

#toObject (readonly)

Returns the value of attribute to.



6
7
8
# File 'lib/griddler/email.rb', line 6

def to
  @to
end

Instance Method Details

#processObject



25
26
27
28
# File 'lib/griddler/email.rb', line 25

def process
  processor_class = config.processor_class
  processor_class.process(self)
end