Class: Griddler::Email

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Email

Returns a new instance of Email.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/html-griddler/email.rb', line 7

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[:html] || params[:text]
  @attachments = extract_attachments
  @spam_score = params[:spam_score]
  @spam_report = params[:spam_report]
  @spf = params[:SPF]
  @dkim = params[:dkim]
end

Instance Attribute Details

#attachmentsObject (readonly)

Returns the value of attribute attachments.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def attachments
  @attachments
end

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def body
  @body
end

#dkimObject (readonly)

Returns the value of attribute dkim.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def dkim
  @dkim
end

#fromObject (readonly)

Returns the value of attribute from.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def from
  @from
end

#raw_bodyObject (readonly)

Returns the value of attribute raw_body.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def raw_body
  @raw_body
end

#spam_reportObject (readonly)

Returns the value of attribute spam_report.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def spam_report
  @spam_report
end

#spam_scoreObject (readonly)

Returns the value of attribute spam_score.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def spam_score
  @spam_score
end

#spfObject (readonly)

Returns the value of attribute spf.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def spf
  @spf
end

#subjectObject (readonly)

Returns the value of attribute subject.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def subject
  @subject
end

#toObject (readonly)

Returns the value of attribute to.



5
6
7
# File 'lib/html-griddler/email.rb', line 5

def to
  @to
end

Instance Method Details

#processObject



21
22
23
24
# File 'lib/html-griddler/email.rb', line 21

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