Class: EmailsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/emails.rb

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ EmailsClient

Initialize the EmailsClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



24
25
26
# File 'lib/lockstep_sdk/clients/emails.rb', line 24

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_emails(body:) ⇒ Object

Creates one or more emails from the specified array of Email Models

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.

Parameters:

  • body (EmailModel)

    The array of emails to be created



79
80
81
82
# File 'lib/lockstep_sdk/clients/emails.rb', line 79

def create_emails(body:)
    path = "/api/v1/Emails"
    @lockstepsdk.request(:post, path, body, nil)
end

#delete_email(id:) ⇒ Object

Deletes the Email referred to by this unique identifier.

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.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Email to delete



59
60
61
62
# File 'lib/lockstep_sdk/clients/emails.rb', line 59

def delete_email(id:)
    path = "/api/v1/Emails/#{id}"
    @lockstepsdk.request(:delete, path, nil, nil)
end

#query_emails(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries Emails on the Lockstep Platform using the specified filtering, sorting, nested fetch, and pagination rules requested.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

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.

Parameters:



95
96
97
98
99
# File 'lib/lockstep_sdk/clients/emails.rb', line 95

def query_emails(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Emails/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_email(id:, include_param:) ⇒ Object

Retrieves the email with the specified email identifier.

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.

Parameters:

  • id (uuid)

    The unique ID number of the Email to retrieve.

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Attachments, CustomFields, Notes, ResponseOrigin



35
36
37
38
39
# File 'lib/lockstep_sdk/clients/emails.rb', line 35

def retrieve_email(id:, include_param:)
    path = "/api/v1/Emails/#{id}"
    params = {:include => include_param}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_email_logo(email_id:, nonce:) ⇒ Object

Retrieves a signature logo for the email with the specified identifier and increments 'ViewCount'.

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.

Parameters:

  • email_id (uuid)

    The unique ID number of the Email to retrieve.

  • nonce (uuid)

    The random nonce applied at time of url creation.



69
70
71
72
# File 'lib/lockstep_sdk/clients/emails.rb', line 69

def (email_id:, nonce:)
    path = "/api/v1/Emails/#{emailId}/logo/#{nonce}"
    @lockstepsdk.request(:get, path, nil, nil)
end

#update_email(id:, body:) ⇒ Object

Updates an existing Email with the information supplied to this PATCH call.

The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired.

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.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the email to update

  • body (object)

    A list of changes to apply to this Email



49
50
51
52
# File 'lib/lockstep_sdk/clients/emails.rb', line 49

def update_email(id:, body:)
    path = "/api/v1/Emails/#{id}"
    @lockstepsdk.request(:patch, path, body.to_camelback_keys.to_json, nil)
end