Send Transactional Mail

Sends a specific transactional email template to a list of recipients.

Notes

  • TemplateID is the transactional template identifier, defined by Optimove (this ID can be found in the Optimove UI, when viewing the template in the Manage Templates page).
  • ScheduleTime is optional, and must be specified in UTC. If not provided, the email will be sent immediately.
  • The Personalizations array is optional. Multiple personalization tags may be provided for each recipient. Each Personalizations block is limited to 50,000 bytes.
  • In the case that personalization tags were not sent as part of the Personalizations array, but are located within the template, the missing tags will populate with an empty value within the email body and the transactional email will be successfully sent. For example, if you have a template which includes “Hi [%TRANS:FIRST_NAME%],” and this tag is not received in the API call then the email will go out simply as “Hi.” In such cases, the response code received will be 206 (partial content) success status. Also, an error message will be received noting the missing tags. To avoid incorrect content from being sent to your customers, within the email body, conditional language can be used to validate whether a given tag has been populated with an empty value or not and dynamically change the content accordingly on a given mail send.
  • Type specifies the MIME type of the attachment (e.g., "text/plain", "text/html", "application/pdf")
  • UniqueMessageID enforces idempotency. This is limited to 254 characters.
  • IsSuccess – true is returned if the send was successful. Otherwise, false.
  • SendID – If the send failed, null is returned.
  • Error – A description of the error. When the send succeeds, null is returned. If the specified template is invalid, Error contains "Invalid template". If idempotency is enforced a 409 error code shows with the following message "Request for this UniqueMessageID has succeeded before".
  • Each call may include a maximum of 200 email recipients.
  • This function supports a maximum of 10 calls per second.

Sample Request

{
  "TemplateID":127,
  "ScheduleTime":"2019-12-14 09:31:00",
  "Recipients":[
  	{"Email":"[email protected]",
  	"Personalizations":[
  		{"Tag":"[%TRANS:FIRST_NAME%]","Value":"Vivienne"},
  		{"Tag":"[%TRANS:FAVORITE_GAME%]","Value":"Bingo Mania"}
  	]
  	},
  	{"Email":"[email protected]",
  	"Personalizations":[
  		{"Tag":"[%TRANS:FIRST_NAME%]","Value":"Tommy"},
  		{"Tag":"[%TRANS:FAVORITE_GAME%]","Value":"Lucky Slots"}
  	]
  	}
  ],
  "Bcc":[{
  	"Email":"[email protected]",
  	"Name":"Adam"
  	}],
  "Attachments":[{
  	"Content":"/*Base64 Encoded Content*/",
  	"Type":"application/pdf",
  	"FileName":"receipt.pdf"
  	}],
  "UniqueMessageID" (optional):"87ba42c0-9431-4266-b808-01cf05867006"
}

Sample Response

{"IsSuccess":true,"SendID":235311,"Error":null}
{"IsSuccess":false,"SendID":null,"Error":"Invalid template"}
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!