Class: Goodmail::EmailParts
- Inherits:
-
Struct
- Object
- Struct
- Goodmail::EmailParts
- Defined in:
- lib/goodmail/email.rb
Overview
Simple struct to hold the rendered HTML and text parts of an email, plus any attachments collected via the ‘attach` / `inline_image` DSL helpers. Custom Action Mailer classes can call Goodmail’s auto-installed ‘goodmail_mail_parts(parts, headers)` helper to apply attachments, pin inline Content-IDs, add unsubscribe headers, and send the multipart body.
‘attachments` defaults to `[]` for backwards compatibility — callers written against 0.3.x keep working unchanged.
Instance Attribute Summary collapse
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#html ⇒ Object
Returns the value of attribute html.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(html: nil, text: nil, attachments: []) ⇒ EmailParts
constructor
A new instance of EmailParts.
Constructor Details
#initialize(html: nil, text: nil, attachments: []) ⇒ EmailParts
Returns a new instance of EmailParts.
15 16 17 |
# File 'lib/goodmail/email.rb', line 15 def initialize(html: nil, text: nil, attachments: []) super(html: html, text: text, attachments: || []) end |
Instance Attribute Details
#attachments ⇒ Object
Returns the value of attribute attachments
14 15 16 |
# File 'lib/goodmail/email.rb', line 14 def @attachments end |
#html ⇒ Object
Returns the value of attribute html
14 15 16 |
# File 'lib/goodmail/email.rb', line 14 def html @html end |
#text ⇒ Object
Returns the value of attribute text
14 15 16 |
# File 'lib/goodmail/email.rb', line 14 def text @text end |