Class: Griddler::Email
- Inherits:
-
Object
- Object
- Griddler::Email
- Includes:
- ActionView::Helpers::SanitizeHelper
- Defined in:
- lib/html-griddler/email.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#dkim ⇒ Object
readonly
Returns the value of attribute dkim.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
-
#spam_report ⇒ Object
readonly
Returns the value of attribute spam_report.
-
#spam_score ⇒ Object
readonly
Returns the value of attribute spam_score.
-
#spf ⇒ Object
readonly
Returns the value of attribute spf.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(params) ⇒ Email
constructor
A new instance of Email.
- #process ⇒ Object
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 = @spam_score = params[:spam_score] @spam_report = params[:spam_report] @spf = params[:SPF] @dkim = params[:dkim] end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
5 6 7 |
# File 'lib/html-griddler/email.rb', line 5 def @attachments end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/html-griddler/email.rb', line 5 def body @body end |
#dkim ⇒ Object (readonly)
Returns the value of attribute dkim.
5 6 7 |
# File 'lib/html-griddler/email.rb', line 5 def dkim @dkim end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
5 6 7 |
# File 'lib/html-griddler/email.rb', line 5 def from @from end |
#raw_body ⇒ Object (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_report ⇒ Object (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_score ⇒ Object (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 |
#spf ⇒ Object (readonly)
Returns the value of attribute spf.
5 6 7 |
# File 'lib/html-griddler/email.rb', line 5 def spf @spf end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
5 6 7 |
# File 'lib/html-griddler/email.rb', line 5 def subject @subject end |
#to ⇒ Object (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
#process ⇒ Object
21 22 23 24 |
# File 'lib/html-griddler/email.rb', line 21 def process processor_class = config.processor_class processor_class.process(self) end |