Class: LockstepSdk::EmailModel
- Inherits:
-
Object
- Object
- LockstepSdk::EmailModel
- Defined in:
- lib/lockstep_sdk/models/email_model.rb
Overview
An Email represents a communication sent from one company to another. The creator of the email is identified by the `CompanyId` field, recipient(s) by the `EmailTo` field, and cc recipient(s) by the 'EmailCC' field. The Email Model represents an email and a number of different metadata attributes related to the creation, storage, and ownership of the email.
Instance Attribute Summary collapse
-
#app_enrollment_id ⇒ Uuid
AppEnrollmentId for this record; used for mapping purposes.
-
#attachments ⇒ AttachmentModel
All attachments attached to this email.
-
#company_id ⇒ Uuid
The ID number of the company that created this email.
-
#created ⇒ Date-time
The date on which this email was created.
-
#created_user_id ⇒ Uuid
The ID number of the user who created this email.
-
#custom_field_definitions ⇒ CustomFieldDefinitionModel
All definitions attached to this email.
-
#custom_field_values ⇒ CustomFieldValueModel
All values attached to this email.
-
#customer_id ⇒ Uuid
The ID number of the customer that sent this email.
-
#email_bcc ⇒ String
The email address(es) for the BCC recipient(s) of this email.
-
#email_body ⇒ String
The body content of this email.
-
#email_cc ⇒ String
The email address for the CC recipient(s) of this email.
-
#email_from ⇒ String
The email address for the sender of this email.
-
#email_id ⇒ Uuid
The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
-
#email_subject ⇒ String
The subject line of this email.
-
#email_to ⇒ String
The email address for the recipient(s) of this email.
-
#external_email_id ⇒ String
The id of the email in an external system if imported.
-
#external_thread_id ⇒ String
The id of the email thread in an external system if imported.
-
#group_key ⇒ Uuid
The GroupKey uniquely identifies a single Lockstep Platform account.
-
#is_priority ⇒ Boolean
A status flag indicating if this email is priority status.
-
#is_spam ⇒ Boolean
A status flag indicating if this email is marked as spam.
-
#is_unread ⇒ Boolean
A status flag indicating if this email is unread.
-
#modified ⇒ Date-time
The date on which this email was modified.
-
#modified_user_id ⇒ Uuid
The ID of the user who modified this email.
-
#notes ⇒ NoteModel
All notes attached to this email.
-
#opened_timestamp ⇒ Date-time
The date on which this email was opened.
-
#received_time_stamp ⇒ Date-time
The date on which this email was received.
-
#response_origin ⇒ EmailModel
The email object associated with the response origin id.
-
#response_origin_id ⇒ Uuid
If the message being sent is a reply or a forward, the id of the the email being replied to or forwarded.
-
#send_type ⇒ String
The type message being sent (New, Reply, Forward) or null for messages not being sent.
-
#sent_date ⇒ Date-time
The date on which this email was sent.
-
#thread_id ⇒ Uuid
The unique ID number of this email's conversation thread.
-
#to_be_sent ⇒ Boolean
A status flag indicating if this email is to be sent.
-
#view_count ⇒ Int32
The number of times this email was viewed.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ EmailModel
constructor
Initialize the EmailModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ EmailModel
Initialize the EmailModel using the provided prototype
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 31 def initialize(params = {}) @email_id = params.dig(:email_id) @thread_id = params.dig(:thread_id) @group_key = params.dig(:group_key) @company_id = params.dig(:company_id) @email_from = params.dig(:email_from) @email_to = params.dig(:email_to) @email_cc = params.dig(:email_cc) @email_subject = params.dig(:email_subject) @email_body = params.dig(:email_body) @sent_date = params.dig(:sent_date) @is_unread = params.dig(:is_unread) @is_priority = params.dig(:is_priority) @is_spam = params.dig(:is_spam) @created = params.dig(:created) @created_user_id = params.dig(:created_user_id) @to_be_sent = params.dig(:to_be_sent) @customer_id = params.dig(:customer_id) @received_time_stamp = params.dig(:received_time_stamp) @opened_timestamp = params.dig(:opened_timestamp) @view_count = params.dig(:view_count) @app_enrollment_id = params.dig(:app_enrollment_id) @external_email_id = params.dig(:external_email_id) @external_thread_id = params.dig(:external_thread_id) @email_bcc = params.dig(:email_bcc) @send_type = params.dig(:send_type) @modified = params.dig(:modified) @modified_user_id = params.dig(:modified_user_id) @response_origin_id = params.dig(:response_origin_id) @response_origin = params.dig(:response_origin) @notes = params.dig(:notes) @attachments = params.dig(:attachments) @custom_field_definitions = params.dig(:custom_field_definitions) @custom_field_values = params.dig(:custom_field_values) end |
Instance Attribute Details
#app_enrollment_id ⇒ Uuid
Returns AppEnrollmentId for this record; used for mapping purposes.
149 150 151 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 149 def app_enrollment_id @app_enrollment_id end |
#attachments ⇒ AttachmentModel
Returns All attachments attached to this email. To retrieve this collection, specify `Attachments` in the “Include” parameter for your query.
189 190 191 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 189 def @attachments end |
#company_id ⇒ Uuid
Returns The ID number of the company that created this email.
81 82 83 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 81 def company_id @company_id end |
#created ⇒ Date-time
Returns The date on which this email was created.
121 122 123 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 121 def created @created end |
#created_user_id ⇒ Uuid
Returns The ID number of the user who created this email.
125 126 127 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 125 def created_user_id @created_user_id end |
#custom_field_definitions ⇒ CustomFieldDefinitionModel
Returns All definitions attached to this email. To retrieve this collection, specify `CustomFieldValues` in the “Include” parameter for your query.
193 194 195 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 193 def custom_field_definitions @custom_field_definitions end |
#custom_field_values ⇒ CustomFieldValueModel
Returns All values attached to this email. To retrieve this collection, specify `Attachments` in the “Include” parameter for your query.
197 198 199 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 197 def custom_field_values @custom_field_values end |
#customer_id ⇒ Uuid
Returns The ID number of the customer that sent this email.
133 134 135 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 133 def customer_id @customer_id end |
#email_bcc ⇒ String
Returns The email address(es) for the BCC recipient(s) of this email.
161 162 163 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 161 def email_bcc @email_bcc end |
#email_body ⇒ String
Returns The body content of this email.
101 102 103 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 101 def email_body @email_body end |
#email_cc ⇒ String
Returns The email address for the CC recipient(s) of this email.
93 94 95 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 93 def email_cc @email_cc end |
#email_from ⇒ String
Returns The email address for the sender of this email.
85 86 87 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 85 def email_from @email_from end |
#email_id ⇒ Uuid
Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
69 70 71 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 69 def email_id @email_id end |
#email_subject ⇒ String
Returns The subject line of this email.
97 98 99 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 97 def email_subject @email_subject end |
#email_to ⇒ String
Returns The email address for the recipient(s) of this email.
89 90 91 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 89 def email_to @email_to end |
#external_email_id ⇒ String
Returns The id of the email in an external system if imported.
153 154 155 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 153 def external_email_id @external_email_id end |
#external_thread_id ⇒ String
Returns The id of the email thread in an external system if imported.
157 158 159 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 157 def external_thread_id @external_thread_id end |
#group_key ⇒ Uuid
Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).
77 78 79 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 77 def group_key @group_key end |
#is_priority ⇒ Boolean
Returns A status flag indicating if this email is priority status.
113 114 115 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 113 def is_priority @is_priority end |
#is_spam ⇒ Boolean
Returns A status flag indicating if this email is marked as spam.
117 118 119 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 117 def is_spam @is_spam end |
#is_unread ⇒ Boolean
Returns A status flag indicating if this email is unread.
109 110 111 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 109 def is_unread @is_unread end |
#modified ⇒ Date-time
Returns The date on which this email was modified. Email modification should only be done by internal services.
169 170 171 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 169 def modified @modified end |
#modified_user_id ⇒ Uuid
Returns The ID of the user who modified this email. Email modification should only be done by internal services.
173 174 175 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 173 def modified_user_id @modified_user_id end |
#notes ⇒ NoteModel
Returns All notes attached to this email. To retrieve this collection, specify `Notes` in the “Include” parameter for your query.
185 186 187 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 185 def notes @notes end |
#opened_timestamp ⇒ Date-time
Returns The date on which this email was opened.
141 142 143 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 141 def @opened_timestamp end |
#received_time_stamp ⇒ Date-time
Returns The date on which this email was received.
137 138 139 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 137 def received_time_stamp @received_time_stamp end |
#response_origin ⇒ EmailModel
Returns The email object associated with the response origin id.
181 182 183 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 181 def response_origin @response_origin end |
#response_origin_id ⇒ Uuid
Returns If the message being sent is a reply or a forward, the id of the the email being replied to or forwarded. Otherwise null.
177 178 179 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 177 def response_origin_id @response_origin_id end |
#send_type ⇒ String
Returns The type message being sent (New, Reply, Forward) or null for messages not being sent.
165 166 167 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 165 def send_type @send_type end |
#sent_date ⇒ Date-time
Returns The date on which this email was sent.
105 106 107 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 105 def sent_date @sent_date end |
#thread_id ⇒ Uuid
Returns The unique ID number of this email's conversation thread.
73 74 75 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 73 def thread_id @thread_id end |
#to_be_sent ⇒ Boolean
Returns A status flag indicating if this email is to be sent.
129 130 131 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 129 def to_be_sent @to_be_sent end |
#view_count ⇒ Int32
Returns The number of times this email was viewed.
145 146 147 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 145 def view_count @view_count end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 201 def as_json(={}) { 'emailId' => @email_id, 'threadId' => @thread_id, 'groupKey' => @group_key, 'companyId' => @company_id, 'emailFrom' => @email_from, 'emailTo' => @email_to, 'emailCC' => @email_cc, 'emailSubject' => @email_subject, 'emailBody' => @email_body, 'sentDate' => @sent_date, 'isUnread' => @is_unread, 'isPriority' => @is_priority, 'isSpam' => @is_spam, 'created' => @created, 'createdUserId' => @created_user_id, 'toBeSent' => @to_be_sent, 'customerId' => @customer_id, 'receivedTimeStamp' => @received_time_stamp, 'openedTimestamp' => @opened_timestamp, 'viewCount' => @view_count, 'appEnrollmentId' => @app_enrollment_id, 'externalEmailId' => @external_email_id, 'externalThreadId' => @external_thread_id, 'emailBcc' => @email_bcc, 'sendType' => @send_type, 'modified' => @modified, 'modifiedUserId' => @modified_user_id, 'responseOriginId' => @response_origin_id, 'responseOrigin' => @response_origin, 'notes' => @notes, 'attachments' => @attachments, 'customFieldDefinitions' => @custom_field_definitions, 'customFieldValues' => @custom_field_values, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
241 242 243 |
# File 'lib/lockstep_sdk/models/email_model.rb', line 241 def to_json(*) "[#{as_json(*).to_json(*)}]" end |