Create and send a newsletter
Create a newsletter and optionally schedule it or send it immediately.
To send the newsletter immediately, set send_now to true. To schedule for later, set scheduled_at to a Unix timestamp in the future. If you don't set either, the newsletter is created as a draft.
If you enabled a subscription center in your workspace, subscription_topic_id is required. Use the subscription center endpoint to find IDs.
Use standard HTML/CSS for the body of an email; this endpoint can't pull in global style variables or render our Design Studio's component syntax. You can create Design Studio emails through other endpoints. All requests must be less than 1 MB.
Request body
Example request
{
"name": "Weekly Product Update",
"type": "email",
"recipients": {
"and": [
{
"or": [
{
"segment": {
"id": 42
}
},
{
"segment": {
"id": 99
}
}
]
},
{
"attribute": {
"field": "plan",
"operator": "eq",
"value": "trial",
"inverse": true
}
}
]
},
"subject": "What's new this week, {{ customer.first_name }}",
"preheader_text": "Check out our latest features and improvements",
"body": "<html><body><h1>Product Updates</h1><p>Here's what we shipped this week...</p></body></html>",
"from": "Product Team <updates@example.com>",
"subscription_topic_id": 5
}Response
Returns the newly created newsletter.
Example response
{
"newsletter": {
"id": 128275,
"deduplicate_id": "128275:1484870424",
"type": "email",
"content_ids": [
45
],
"name": "Weekly Product Update",
"sent_at": 1481653929,
"created": 1481653919,
"updated": 1481653929,
"recipient_segment_ids": [
42,
99
],
"tags": [
"Product Updates"
],
"subscription_topic_id": 5
}
}Changes
No recorded changes to this endpoint across all 1 revision of this API.