Manage a transactional campaign
Request
Parameter |
In |
Type |
Required |
Description |
---|---|---|---|---|
|
header |
string |
true |
Determines the expected format and data type to retrieve the response data. Value: |
|
query |
string |
true |
The API key of your account. |
|
body |
object |
false |
An array containing the parameters of the sender: Email - the email address of a verified sender. sendersName - the name of the sender name displayed in the recipient's inbox. |
|
body |
object |
false |
An array containing the parameters of the sender the user can reply to: Email - the email address of one of a verified sender. sendersName - the name of the Reply to email displayed to the user when the user clicks Reply. |
|
body |
string |
true |
The subject line of the email message displayed to the recipient. It may contain parameters for personalization. When no value is provided, use the subject of the template. |
|
body |
GUID |
false |
Statistics will be registered to the campaign with this ID. If you have created a template id, you can find it in the user interface. If the array |
|
body |
string |
false |
The name of the transactional campaign that this message will be sent for. Transactional campaign names are unique. If the array |
|
body |
array |
false |
Content types: Type - the type of content to send. Value - the format specified by WebLocation - the URL that holds the content to use for this this message. To reuse it for the next requests and avoid re-downloading, cache it to S3 for 24 hours. Only one |
|
body |
array |
true |
A list of recipients of the transactional message. It may contain personalization parameters. To - an array containing the parameters of the receiver Email - the recipient email address (text/plain). Name - the recipient name (text/plain). Substitutions - the values to substitute in the message content/subject for the current recipient, in the form of key/value pairs. |
|
body |
array |
true |
When set to Default: BypassUnsubscribeManagement Enable - |
|
body |
object |
false |
An array containing the parameters of the attachments: - Content - A base64 string that represents the file bytes of the attachment (Required). Type - The MIME type of the attached content (e.g. application/pdf, image/PNG) (Required). FileName - The file name of the attachment that the recipient will see (Required). Disposition - Allowed values are: “inline”, “attachment” (Required). ContentId - A user-defined string that maps an embedded image to an attachment. (Required only for inline disposition). |
POST /v3/campaigns/transactional/send.json?apikey= HTTP/1.1
Host: {hostname}
Content-Type: application/json
Content-Length: 2165
{
"From": {
"Email": "[email protected]",
"Name": "Example Order Confirmation"
},
"ReplyTo": {
"Email": "[email protected]",
"Name": "Example Customer Service Team"
},
"Subject": "Your Example Order Confirmation",
"TemplateId": "d59b39d5-da76-4797-8f24-c1265bb903b8",
"TemplateName": "My Sending Template",
"Content": [
{
"Type": "text/html",
"Value": "<p>Hello world</p>",
"WebLocation": "https://mycompany.com/template.html"
}
],
"Personalizations": [
{
"To": [
{
"Email": "[email protected]",
"Name": "John Doe"
}
],
"Substitutions": {
"key1": "value1",
"key2": "value2"
}
},
{
"To": [
{
"Email": "[email protected]",
"Name": "Julia Doe"
}
],
"Substitutions": {
"key1": "value1",
"key2": "value2"
}
}
],
"MailSettings": {
"BypassUnsubscribeManagement": {
"Enable": true
}
},
"attachments": [
{
"content": "iVBORw0KGgoAAAANSUhEUgAABYMAAAOgCAYAAABvGmkhAAAABGdBTUEAAwAAAAA0AeMwQAAAAAAfcAYDAAAAADQB4zBAAAAAAB9wBgMAAAAANAHjMEAAAAAAH3AGAwAAAAA0AeMwQAAAAAAPe+T+J/nnNIPnRqhbwAAAABJRU5ErkJggg==",
"Type": "application/pdf",
"FileName": "attachementexample.pdf",
"disposition": "attachment",
"ContentId": "attachment-a"
},
{
"content": "iVBORw0KGgoAAAAAfcAYDAAAAADQB4zBAAAAAAB9wBgMAAAAANAHjMEAAAAAAH3AGAwAAAAA0AeMwQAAAAAAfcAYDAAAAADQB4zBAAAAAAB9wBgMAAAAANAHjMEAAAAAAH3AGAwAAAAA0AeMwQAAAAAAPe+T+J/nnNIPnRqhbwAAAABJRU5ErkJggg==",
"type": "image/PNG",
"filename": "imageexample.png",
"disposition": "inline",
"contentId": "image-a"
}
]
}
Response
Status |
Description |
Headers |
Schema |
---|---|---|---|
|
The request is successful. |
|
N/A |
{
"TotalAccepted": 1,
"TotalExcluded": 1,
"ExcludedRecipients": [
{
"Email": "[email protected]",
"Reason": "The recipient was found with status bounced"
}
]
}