After you are done with the Configuration step, you may initiate sending transactional emails.
First of all we will need to obtain a valid token based on your API key and your API Secret as described in section "Get authenticated using your application credentials"
## Request fields
attachments An array of attachmentObject in the following format:
[{"content":"base64 encoded data", "type":"mime/type", "filename":"attachment file name you wish"}, ...]
Path | Type | Description |
---|---|---|
content | String | The attachment content base64encoded If provided, must not be blank |
type | String | The attachment (mime) type If provided must not be blank |
filename | String | The attachment file name If provided, must not be blank. Size must be between 0 and 128 inclusive |
bcc An array of Objects in the format [{"name":"Name to be included", "address":"[email protected]"}, ...]. These recipient will receive a blind carbon copy.
Path | Type | Description |
---|---|---|
name | String | The name of the blind carbon copy recipient |
address | String | The actual email address of the blind carbon copy recipient Must be a well-formed email address. Must not be blank |
callback an Object of Objects containing two properties indicating call-backs to be executed when a message changes status or when recipient performs an action on the message (Open/Click).
Path | Type | Description |
---|---|---|
statusCallback | Object | Callback information regarding message status. Contains two properties called "strategy" and "url". |
eventCallback | Object | Callback information regarding events (onClick/onOpen etc.). If provided, at least one of the event urls must exist. |
cc Carbon Copy: this array of Objects contains additional recipient in the format [{"name":"Name to be included", "address":"[email protected]"}, ...] that will get the same message.
Path | Type | Description |
---|---|---|
name | String | The name of the carbon copy recipient |
address | String | The actual email address of the carbon copy recipient. If provided, must be a well-formed email address and not be blank |
content This Object encapsulates the actual message body. Email Plus supports two type of message content HTML and UTF-8 TEXT .
Path | Type | Description |
---|---|---|
html | String | The html content of the email message Must not be null/blank/empty |
text | String | Optional, the text content of the email message |
customheaders An array of custom headers to be included in call-backs and tracking. Email Plus accepts up to 10 custom headers in object format {"name":"xxx", "value":"yyy"}.
Path | Type | Description |
---|---|---|
name | String | The name of the custom header. If provided it must not be null. The Size must be between 1 and 60 inclusive. |
value | String | The value of the custom header. If provided must not be blank |
dsn Delivery Status Notification Object enabling DSN functionality of Email Plus.
Path | Type | Description |
---|---|---|
notify | String (enumeration) | Comma separated notification statuses. Should be comma separated values of FAILURE, DELAY, SUCCESS or NEVER. NEVER cannot be combined with any of the other values. |
orcpt | String (email) | Email address (orcpt) to receive the Notification. Must be a well-formed email address. |
envid | String | Envelope identifier (envid). It may be set to custom ID if DSN notification will be processed by an automated system. |
event callback An object containing two properties one for onClick event and the second for onOpen event. If supplied, both must be valid, reachable URLs accepting HTTP Method POST.
Path | Type | Description |
---|---|---|
onClick | String (url) | The callback url of the 'onClick' action. Must be a well-formed URL, accepting POST HTTP method |
onOpen | String (url) | The callback url of the 'onOpen' action Must be a well-formed URL, accepting POST HTTP method |
footer An Object containing two properties one for html message part and one for text part.
Path | Type | Description |
---|---|---|
html | String (partial HTML) | The html content of footer If footer object is present this property must not be null |
text | String | The text content of the footer. If present should be pure UTF8 text |
from An Object indicating who will appear as sender in the message.
Path | Type | Description |
---|---|---|
name | String | The friendly name of the sender |
address | String (email address) | The actual email address of the sender. Must be a well-formed email address. Must not be blank |
replyto An Object indicating where to send the response if recipient hits "Reply To" button.
name | String | The name of the reply to address |
address | String (email address) | The actual email address regarding the reply to information. If the Object is present, this property must be a well-formed email address and not blank |
Request fields-status callback info
Path | Type | Description |
---|---|---|
strategy | String(Enumeration) | Valid values are OnCompletion and OnChange if the object is supplied, this property is required. |
url | String (url) | The url of the callback. Must be a well-formed, reachable URL. |
to An array of objects indicating message recipient(s) in format [{"name":"Recipient Name","address":"recipient_email_address"} ,...]
Path | Type | Description |
---|---|---|
name | String | The name of the standard recipient |
address | String (email address) | The actual email address of the standard recipient. Must be a well-formed email address. |
Request fields Summary
Path | Type | Description |
---|---|---|
from | Object | The sender information of the email Address must be one of the Authorized senders. Required |
replyTo | Object | Information regarding the reply to address |
to[] | Array of Email Address Objects | The standard email recipient addresses along with (optional) name information. Must contain at least one recipient. Required |
cc[] | Array of Email Address Objects | The carbon copy email recipient addresses along with (optional) name information. Optional |
bcc[] | Array of Email Address Objects | The blind carbon copy email recipient addresses along with (optional) name information. Optional |
customHeaders[] | Array of customHeader Objects | List of custom headers. No more than 10 elements. Optional |
subject | String | The subject of the email. Size must be less than 145 characters. Skipping this property is strongly discouraged |
content | Object | The actual content of the email message. Contains two properties html containing the HTML content and text for text only UTF-8 content. |
attachments[] | Array of attachmentObject | Attachments of the email message. The attachmentObject has the following format:{"content":"base64 encoded data", "type":"mime/type", "filename":"attachment file name you wish"} |
scheduledDate | String | The date and time to send the email message(s) . Given date must be {offset} {unit} after now |
ttl | Number | Time-to-live value in minutes, after this period, if the message is not delivered it will be considered as failed. Must be a positive number of minutes between 30 and 4320 (72H). |
maxAttempts | Number | The maximum send retries to apply on transitional failures. |
footer | Object | The footer to apply on the message, containing two properties html and text to be applied on the actual content of the message |
callback | Object | Callback related information regarding the execution. If provided, at least one type of callback information must exist. |
label | String | Custom label for the email message(s). A string up to 80 characters long that categorizes the message. |
dsn | Object | Delivery status notifications (DSN) options |
Response fields
Path | Type | Description |
---|---|---|
trackingId | String | The tracking id of the transactional email execution |
Table 1. HTTP 400
errorCode | type | Explanation |
---|---|---|
000000 | InvalidDomain | The provided sender domain is invalid. It needs to get added and verified to be used. |
000001 | InvalidSender | The provided sender is invalid. It needs to get added and verified to be used. |
000002 | UnverifiedSender | The provided sender is unverified. It needs to get verified to be used. |
000004 | NoActiveSubscription | No active transactional email subscription exists |
000005 | InsufficientResourcesException | In case resources are not enough to send email (depleted or limited) |