Emails
Emails are the simple and efficient way to craft one off messages such as welcome emails, password resets, or other crucial transactional communications. Requests are instant and queued into a priority queue. Most requests will be processed within 1-5 seconds.
Available Endpoints
Method | Endpoint | Name |
---|---|---|
POST | /batch/emails | Create Emails |
The Email Model
The email model resembles a standard email but includes additional flags and custom data fields for merging into the provided HTML.
Properties
- Name
to
- Type
- string
- Description
The email address of teh recipient.
- Name
from
- Type
- string
- Description
The email address of the sender. Must be an author in your account.
- Name
subject
- Type
- string
- Description
The subject of the email.
- Name
html_body
- Type
- string
- Description
The HTML body of the email.
- Name
transactional
- Type
- boolean
- Description
true
orfalse
flag if the email is transactional or not.
- Name
personalizations
- Type
- object
- Description
key
value
pair custom data to be injected into the email.
Create Emails
Requests are instant and queued into a priority queue. Most requests will be processed within 30 seconds.
emails
that can contain 1 to 60 emails made up of the following keys. Required Attributes
- Name
to
- Type
- string
- Description
The email address of teh recipient.
- Name
from
- Type
- string
- Description
The email address of the sender. Must be an author in your account.
- Name
subject
- Type
- string
- Description
The subject of the email.
- Name
html_body
- Type
- string
- Description
The HTML body of the email.
- Name
transactional
- Type
- boolean
- Description
true
orfalse
flag if the email is transactional or not.
Optional Attributes
- Name
personalizations
- Type
- object
- Description
key
value
pair custom data to be injected into the email.
Request
curl -L -X POST 'https://app.bentonow.com/api/v1/batch/emails?site_uuid=ExampleID1234' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic BASE64ENCODE(USERNAME+PASSWORD)' \
--data-raw '{
"emails": [
{
"to": "[email protected]",
"from": "[email protected]",
"subject": "Reset Password",
"html_body": "<p>Here is a link to reset your password ... {{ link }}</p>",
"transactional": true,
"personalizations": {
"link": "https://example.com/test"
}
}
]
}'
Response
Returns the count of emails queued for delivery.
JSON Response
{
"results": 1
}