Class: GovDelivery::TMS::EmailMessage
- Inherits:
-
Object
- Object
- GovDelivery::TMS::EmailMessage
- Includes:
- InstanceResource
- Defined in:
- lib/govdelivery/tms/resource/email_message.rb
Overview
An EmailMessage is used to create and send a email to a collection of EmailRecipient objects. Certain metrics are available after the email is sent, including the collection of recipients who clicked or opened the email.
The message-level macros are used when a recipient has no value for a given macro key.
Instance Attribute Summary collapse
-
#body ⇒ String
The body of the email.
-
#click_tracking_enabled ⇒ Boolean
Optional - Whether to track clicks on links in this message.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#errors_to ⇒ String
Optional - the email address used for the Errors-To header of this email.
-
#from_email ⇒ String
Optional - the email address of the person or entity sending the email.
-
#from_name ⇒ String
The name of the person or entity sending the email.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#macros ⇒ Hash
Optional - A dictionary of key/value pairs to use in the subject and body as default macros.
-
#open_tracking_enabled ⇒ Boolean
Optional - Whether to track opens on this message.
-
#reply_to ⇒ String
Optional - the email address used for the Reply-To header of this email.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subject ⇒ String
The subject of the email.
Attributes included from InstanceResource
Instance Method Summary collapse
-
#clicked ⇒ Object
A CollectionResource of EmailRecipients that clicked on at least one link in this email.
-
#failed ⇒ Object
A CollectionResource of EmailRecipients that failed, not neccessarily bounced.
-
#opened ⇒ Object
A CollectionResource of EmailRecipients that opened this email.
-
#recipients ⇒ Object
A CollectionResource of EmailRecipients on this email.
-
#sent ⇒ Object
A CollectionResource of EmailRecipients that sent successfully.
Methods included from InstanceResource
Instance Attribute Details
#body ⇒ String
The body of the email.
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def body @body end |
#click_tracking_enabled ⇒ Boolean
Optional - Whether to track clicks on links in this message. Defaults to true.
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def click_tracking_enabled @click_tracking_enabled end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
1 2 3 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 1 def created_at @created_at end |
#errors_to ⇒ String
Optional - the email address used for the Errors-To header of this email. Defaults to the account default bounce_email address (which itself defaults to the default from address if not specified).
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def errors_to @errors_to end |
#from_email ⇒ String
Optional - the email address of the person or entity sending the email. Must be configured in TMS beforehand. Defaults to the account default from address.
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def from_email @from_email end |
#from_name ⇒ String
The name of the person or entity sending the email.
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def from_name @from_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
1 2 3 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 1 def id @id end |
#macros ⇒ Hash
Optional - A dictionary of key/value pairs to use in the subject and body as default macros.
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def macros @macros end |
#open_tracking_enabled ⇒ Boolean
Optional - Whether to track opens on this message. Defaults to true.
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def open_tracking_enabled @open_tracking_enabled end |
#reply_to ⇒ String
Optional - the email address used for the Reply-To header of this email. Defaults to the account default reply_to_email address (which itself defaults to the default from address if not specified).
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def reply_to @reply_to end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
1 2 3 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 1 def status @status end |
#subject ⇒ String
The subject of the email.
43 44 45 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 43 def subject @subject end |
Instance Method Details
#clicked ⇒ Object
A CollectionResource of EmailRecipients that clicked on at least one link in this email
70 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 70 collection_attribute :clicked, 'EmailRecipients' |
#failed ⇒ Object
A CollectionResource of EmailRecipients that failed, not neccessarily bounced
78 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 78 collection_attribute :failed, 'EmailRecipients' |
#opened ⇒ Object
A CollectionResource of EmailRecipients that opened this email
66 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 66 collection_attribute :opened, 'EmailRecipients' |
#recipients ⇒ Object
A CollectionResource of EmailRecipients on this email
62 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 62 collection_attribute :recipients, 'EmailRecipients' |
#sent ⇒ Object
A CollectionResource of EmailRecipients that sent successfully
74 |
# File 'lib/govdelivery/tms/resource/email_message.rb', line 74 collection_attribute :sent, 'EmailRecipients' |