POST https://api.expresspigeon.com/messages
JSON object represents a message to be sent.
Parameter | Required | Description |
---|---|---|
template_id | Yes | Template template id to be sent |
to | Yes | Email address to send message to |
reply_to | Yes | Email address to reply to |
from | Yes | From name, such as your name or name of your organization |
subject | Yes | Email message subject |
reply_name | No |
Name for 'Reply-To' email field, defaults to 'from' |
from_address | No |
Email for 'From' email field, defaults to 'reply_to' |
merge_fields | No |
Values for merge fields |
headers | No |
Custom headers |
view_online | No |
Generates online version of sent message. We will host this generated message on our servers, default is false |
click_tracking | No |
Overwrites all URLs in email to point to http://clicks.expresspigeon.com for click tracking. Setting it to false will preserve all URLs intact, but click tracking will not be available, default is true |
suppress_address | No |
If true suppresses insertion of sender's physical address in the email, default is false |
dictionaries | No |
List of dictionaries to source merge fields from. Dictionary values override all other values (from merge_fields) in case of name collisions. See Dictionaries section for more information. |
flow | No |
Trigger to start a flow in case of open or click in email. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
1 2 3 4 5 |
|
1 2 3 4 5 6 7 |
|
The code above also shows that it is possible to inject HTML chunks into specific placeholders inside your email template.
NOTE: It is important to use only single quotes in injected HTML
1 2 3 4 5 6 |
|
In the call above, the id
represents an ID of a message that was sent. You can use this value in order to get a report on the status of this message.
As mentioned in a Request parameters, one of the parameters is a flow
:
"flow": {
"id": 321,
"trigger": "click"
}
If you want to trigger a Flow when a contact opens your transactional message, use this parameter:
"flow": {
"id": 321,
"trigger": "open"
}
Unlike a regular transactional message, these parameters require that the contact exists on your account.
In other words, if you use the flow
parameter and the email you are sending does not exist on your account as a contact, you will get the following response:
{
"status": "error",
"code": 400,
"message": "this contact does not exist: 'jane@example.net', but required to trigger a flow"
}
A flow based on an open or a click trigger will only start for a contact once regardless how many times that contact will open or click the same message.
For more information on flows, please refer to Flows and Flow API.