Class: EmailsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/emails_client.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_client.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



85
86
87
88
# File 'lib/lockstep_sdk/clients/emails_client.rb', line 85

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



62
63
64
65
# File 'lib/lockstep_sdk/clients/emails_client.rb', line 62

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:



102
103
104
105
106
# File 'lib/lockstep_sdk/clients/emails_client.rb', line 102

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



36
37
38
39
40
# File 'lib/lockstep_sdk/clients/emails_client.rb', line 36

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.



74
75
76
77
# File 'lib/lockstep_sdk/clients/emails_client.rb', line 74

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



51
52
53
54
# File 'lib/lockstep_sdk/clients/emails_client.rb', line 51

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