Class: Hanami::Mailer::Message Private
- Inherits:
-
Object
- Object
- Hanami::Mailer::Message
- Defined in:
- lib/hanami/mailer/message.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents an email message
Instance Attribute Summary collapse
- #attachments ⇒ Object readonly private
- #bcc ⇒ Object readonly private
- #cc ⇒ Object readonly private
- #charset ⇒ Object readonly private
- #delivery_options ⇒ Object readonly private
- #from ⇒ Object readonly private
- #headers ⇒ Object readonly private
- #html_body ⇒ Object readonly private
- #reply_to ⇒ Object readonly private
- #return_path ⇒ Object readonly private
- #subject ⇒ Object readonly private
- #text_body ⇒ Object readonly private
- #to ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(from:, subject:, to: nil, cc: nil, bcc: nil, reply_to: nil, return_path: nil, html_body: nil, text_body: nil, attachments: [], headers: {}, charset: "UTF-8", delivery_options: {}) ⇒ Message
constructor
private
Initialize a new message.
-
#to_h ⇒ Hash
private
Convert message to hash representation.
Constructor Details
#initialize(from:, subject:, to: nil, cc: nil, bcc: nil, reply_to: nil, return_path: nil, html_body: nil, text_body: nil, attachments: [], headers: {}, charset: "UTF-8", delivery_options: {}) ⇒ Message
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a new message
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hanami/mailer/message.rb', line 32 def initialize(from:, subject:, to: nil, cc: nil, bcc: nil, reply_to: nil, return_path: nil, html_body: nil, text_body: nil, attachments: [], headers: {}, charset: "UTF-8", delivery_options: {}) @from = normalize_addresses(from) @to = normalize_addresses(to) @cc = normalize_addresses(cc) @bcc = normalize_addresses(bcc) @reply_to = normalize_addresses(reply_to) @return_path = normalize_addresses(return_path) @subject = subject @html_body = html_body @text_body = text_body @attachments = @headers = headers @charset = charset @delivery_options = validate_sender! validate_recipients! end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/hanami/mailer/message.rb', line 13 def @attachments end |
#bcc ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/mailer/message.rb', line 10 def bcc @bcc end |
#cc ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/mailer/message.rb', line 10 def cc @cc end |
#charset ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/hanami/mailer/message.rb', line 13 def charset @charset end |
#delivery_options ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/hanami/mailer/message.rb', line 13 def @delivery_options end |
#from ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/mailer/message.rb', line 10 def from @from end |
#headers ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/hanami/mailer/message.rb', line 13 def headers @headers end |
#html_body ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/hanami/mailer/message.rb', line 13 def html_body @html_body end |
#reply_to ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/mailer/message.rb', line 10 def reply_to @reply_to end |
#return_path ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/mailer/message.rb', line 10 def return_path @return_path end |
#subject ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/mailer/message.rb', line 10 def subject @subject end |
#text_body ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/hanami/mailer/message.rb', line 13 def text_body @text_body end |
#to ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/mailer/message.rb', line 10 def to @to end |
Instance Method Details
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert message to hash representation
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/hanami/mailer/message.rb', line 58 def to_h { from: from, to: to, cc: cc, bcc: bcc, reply_to: reply_to, return_path: return_path, subject: subject, html_body: html_body, text_body: text_body, attachments: , headers: headers, charset: charset, delivery_options: } end |