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



22
23
24
# File 'lib/lockstep_sdk/clients/emails.rb', line 22

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_emailsObject

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



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

def create_emails()
    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



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

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

#query_emails(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ 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:



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

def query_emails(filter:, include_param:, order:, pageSize:, pageNumber:)
    path = "/api/v1/Emails/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber}
    @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



33
34
35
36
37
# File 'lib/lockstep_sdk/clients/emails.rb', line 33

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(emailId:, 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:

  • emailId (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
73
# File 'lib/lockstep_sdk/clients/emails.rb', line 69

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

#update_email(id:) ⇒ 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



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

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