Event Triggered Email

POST https://restapi.actonsoftware.com/ete/v1/email/{Account ID}/{Template ID}

Event Triggered Email is a service for sending email to a recipient in response to a specific event or transaction (and not as part of a bulk marketing campaign).

Parameters

Name Parameter
Type
Allow
Multiple
Required/
Optional
Data Type Description
Authorization: Header False Required String Insert your generated access token.
("Bearer {access token}")
toAddress False Required JSON Specify the email address to send the message to.
ccAddressList False Optional JSON Specify email addresses that to CC.
(Limited 5)
fromAddress False Optional JSON Specify the verified sender email address.
(Default = Template Selected/Template Creator)
fromDisplayName False Optional JSON Specify the verified sender name.
replyToAddress False Optional JSON Specify the verified reply-to email address.
(Default = "fromAddress")
subjectLine False Optional JSON (Max 90 Characters) Specify a subject for the message.
(Default = Template Subject)
personalizationDataMap False Optional JSON A key/value map specifying the values of personalization inside message template.
previewText False Optional JSON (Max 240 Characters) Specify the preview text.
(Default = Template Preview Text)
transactional False Optional JSON Specify "true" if purchased transactional email and want to indicates that this message conforms to the legal definition of transactional email.
externalId False Optional JSON (Max 128 Characters) Specify an identifier from your system.
(Ex. Order Number or Confirmation Number)
tagList False Optional JSON (Max 48 Characters) Specify a tag for grouping visible reports of similar tags for used template.
(Limit 1 Tag)
trackOpens False Required JSON Indicates if you want message opens tracked.
("true","false")
trackClicks False Required JSON Indicates if you want message clicks tracked.
("true","false")

Below is the full JSON using the parameters above.

{
 "envelope": {
   "toAddress": "jane.doe@act-on.com",
   "ccAddressList": ["john.doe@act-on.com"],
   "fromAddress": "john@act-on.com",
   "fromDisplayName": "John from Act-On",
   "replyToAddress": "noreply@act-on.com"
 },
 "content": {
   "subjectLine": "Your order has shipped.",
   "personalizationDataMap": {
     "orderNumber": "3423423-234234",
     "trackingLink": "https://www.act-on.com/tracking/12313123123213",
     "name": "Jane Doe"
   },
   "previewText": "Great news! Your order is on the way."
 },
 "metadata": {
   "transactional": true,
   "externalId": "245-lfkg-23423-lkj",
   "tagList": ["shipping_notifications"]
 },
 "actions": {
   "trackOpens": true,
   "trackClicks": true,
   "deliveryWhenDelayed": "TRUE"
 }
}

Response

200, message = "Successfully Accepted"
400, message = "Sender Not Allowed"
400, message = "Invalid ID in request. accountId or templateId is invalid"
400, message = "Validation Failed for emailDetails object"
400, message = "Personalization Failure Exception. personalization fields were missed"
401, message = "Account Temporarily Suspended"
401, message = "Unauthorized Request"
503, message = "IO Exception was encountered"
500, message = "Internal Server Error"

Code Examples

cURLPython

curl -X POST 'https://restapi.actonsoftware.com/ete/v1/email/{Account ID}/{Template ID}' -H 'Authorization: Bearer  12345678-9abc-defg-hijk-lmnopqrs' -H 'Content-Type: application/json' --data-raw '{"envelope":{"toAddress":"jane.doe@act-on.com","fromAddress": "john.doe@act-on.com","fromDisplayName": "John from Act-On","replyToAddress": "noreply@act-on.com"},"content": {"subjectLine": "Your order has shipped.","personalizationDataMap": {},"previewText": "Great news! Your order is on the way."},"metadata": {"transactional": true,"externalId": "123-4567-89101-112","tagList": ["shipping_notifications"]},"actions": {"trackOpens": true,"trackClicks": true,"deliveryWhenDelayed": "TRUE"}}'

import http.client
import mimetypes
conn = http.client.HTTPSConnection("restapi.actonsoftware.com")
payload = "{\n    \"envelope\": {\n        \"toAddress\": \"jane.doe@act-on.com\",\n        \"fromAddress\": \"john.doe@keemail.me\",\n        \"fromDisplayName\": \"John from Act-On\",\n        \"replyToAddress\": \"noreply@act-on.com\"\n    },\n    \"content\": {\n        \"subjectLine\": \"Your order has shipped.\",\n        \"personalizationDataMap\": {},\n        \"previewText\": \"Great news! Your order is on the way.\"\n    },\n    \"metadata\": {\n        \"transactional\": true,\n        \"externalId\": \"123-4567-89101-112\",\n        \"tagList\": [\n            \"shipping_notifications\"\n        ]\n    },\n    \"actions\": {\n        \"trackOpens\": true,\n        \"trackClicks\": true,\n        \"deliveryWhenDelayed\": \"TRUE\"\n    }\n}"
headers = {
  'Authorization': 'Bearer  12345678-9abc-defg-hijk-lmnopqrs',
  'Content-Type': 'application/json',
}
conn.request("POST", "ete/v1/email/{Account ID}/{Template ID}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))