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
24
25
26
27
28
# File 'lib/griddler/email.rb', line 9

def initialize(params)
  @params = params

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

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

  @headers = extract_headers

  @cc = recipients(:cc)

  @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

#ccObject (readonly)

Returns the value of attribute cc.



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

def cc
  @cc
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

#raw_htmlObject (readonly)

Returns the value of attribute raw_html.



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

def raw_html
  @raw_html
end

#raw_textObject (readonly)

Returns the value of attribute raw_text.



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

def raw_text
  @raw_text
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



30
31
32
33
34
# File 'lib/griddler/email.rb', line 30

def process
  processor_class  = config.processor_class
  processor_method = config.processor_method
  processor_class.public_send(processor_method, self)
end