Easymailing
Email batches

Send a separate email to each recipient

POST /email_batches/actions/send

POST/email_batches/actions/send

Sends the same message as one individual email to each of 2 to 50 recipients from the user's Gmail mailbox, so nobody sees the others. Each recipient gets their own send, personalized and queued five minutes apart.

When to use: When the user wants to write to several people one by one (for example every contact of a company) and has confirmed the text and the list. It reaches many people, so confirm with the user before calling it.

When not to use: For one email addressed to several people who see each other, use send_email with several addresses in to. To prepare it without sending, use create_email_draft. For a mass mailing to an audience, use the email campaign operations: a batch is limited to 50 and to the user's mailbox limits.

Side effects: One email per recipient of to, each with their own unsubscribe link (if you include the unsubscribe block), spaced at least five minutes apart within the mailbox limits (12 per hour, 200 per day), so a batch of 50 takes hours to finish. The whole batch has ONE undo window of 10 seconds, plus 10 of grace. It is delivered asynchronously by background jobs; this call answers 202 with one send per recipient. If the record is a contact, each email is linked to the contact that owns that address; from a company or opportunity they are linked only to the record. Failures notify the user in the app. Replaying the same idempotency_key returns the same batch.

Filters: Opt-out protection as in send_email: 409 recipient_opted_out with the addresses, until acknowledged_opt_outs lists them.

Permissions: Requires a CRM seat and the crm.contacts_companies.write capability. The sender must be a mailbox the user can send from: one of their own or one shared with them (see list_email_senders). Writing from an opportunity also requires crm.opportunities.read and the Work level on its pipeline.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Request Body

The new EmailBatch resource

TypeScript Definitions

Use the request body type in TypeScript.

Email batches of the public API (fase 5): the same message as a separate email to each of 2 to 50 people. Generated from the proposal by fase-5/tools/gen_email_sending_api.py; the texts are the proposal's. sends are the sends of the batch with the fields of get_email_send and their @id. A batch belongs to its author: for anyone else it answers 404 email_send_not_found.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.easymailing.com/email_batches/actions/send" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "idempotency_key": "0cd90e5a-2c03-4ab6-81a8-d48818026e58",    "sender_uuid": "6fd60e87-ecde-4069-8fdb-aebbacafea6d",    "record": "/entity/1",    "mode": "compose",    "source_email": "/entity/1",    "to": [      "string"    ],    "cc": [      "string"    ],    "bcc": [      "string"    ],    "subject": "string",    "body_html": "string",    "attachment_ids": [      "string"    ],    "forwarded_attachment_ids": [      "string"    ],    "acknowledged_opt_outs": [      "string"    ],    "draft": "/entity/1",    "replaces_send": "/entity/1"  }'
{  "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",  "release_at": "2019-08-24T14:15:22Z",  "cancellable": true,  "sends": [    {}  ]}