EmailsAPI

new EmailsAPI(rest)

This class is used to interact with Emails in TidyHQ.
Parameters:
NameTypeDescription
restRestThe rest instance to use for requests.

Methods

(async) createEmail(email, optionsopt) → {Promise.<TidyAPI_V1_Email>}

Create a new email.
Parameters:
NameTypeAttributesDefaultDescription
emailobjectThe email to create.
Properties
NameTypeDescription
subjectstringThe subject of the email.
bodystringThe body of the email.
contactsArray.<number>The contacts to send the email to.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The email.
Type: 
Promise.<TidyAPI_V1_Email>

(async) getEmail(email_id, optionsopt) → {Promise.<TidyAPI_V1_Email>}

Get a specific email associated with the access token.
Parameters:
NameTypeAttributesDefaultDescription
email_idstringThe ID of the email.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The email.
Type: 
Promise.<TidyAPI_V1_Email>

(async) getEmails(optionsopt) → {Promise.<TidyAPI_V1_Emails>}

Get the emails associated with the access token.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The emails.
Type: 
Promise.<TidyAPI_V1_Emails>