Schedule an email for later
POST /email_sends/actions/schedule
/email_sends/actions/scheduleSchedules an email from the user's connected Gmail mailbox to leave at a chosen time, written from a contact, company or opportunity. It is stored and released at scheduled_at or later, if the mailbox has reached its sending limit by then.
When to use: When the user wants the email to go out at a specific date and time (tomorrow at 9, next Monday) and has confirmed the final recipients, text and time. It reaches other people, so confirm with the user before calling it.
When not to use: To send right away, use send_email. To save without sending, use create_email_draft. To change the time of an email already scheduled: cancel it with cancel_email_send and schedule it again; to edit its text too, open it first with reopen_email_send.
Side effects: The email goes out through the Gmail account of the chosen sender, as the user, to the recipients in to, cc and bcc. Nothing leaves before scheduled_at. It is released asynchronously by a background job, so read state with get_email_send. There is no undo window, but it can be cancelled with cancel_email_send while state is queued, and brought forward with send_queued_email_now. A user can have at most 100 scheduled emails. A failed send notifies the user in the app.
Filters: The same opt-out protection as 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.
Value for the X-Auth-Token header parameter.
In: header
The new EmailSend resource
TypeScript Definitions
Use the request body type in TypeScript.
Email sends of the public API (fase 5). Generated from the proposal by fase-5/tools/gen_email_sending_api.py; the
texts are the proposal's. Every operation checks the CRM access in its provider or processor before anything else,
because API Platform evaluates security after the provider.
Sending and scheduling are two operations over the same use case (QueueEmailSend): send_email takes no
scheduled_at and schedule_email requires it. Both answer 202: the email is queued and the worker sends it.
The actions (cancel, send_now, retry, discard) take no body and answer the send as it is afterwards. A send
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_sends/actions/schedule" \ -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", "scheduled_at": "2019-08-24T14:15:22Z" }'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "state": "queued", "failure_reason": "rejected", "release_at": "2019-08-24T14:15:22Z", "scheduled_at": "2019-08-24T14:15:22Z", "sender_uuid": "6fd60e87-ecde-4069-8fdb-aebbacafea6d", "sender_address": "user@example.com", "contact": "/entity/1", "record": "/entity/1", "record_type": "contact", "record_name": "string", "mode": "compose", "subject": "string", "to": [ "string" ], "cc": [ "string" ], "bcc": [ "string" ], "recipients": [ {} ], "batch": "/entity/1", "created_at": "2019-08-24T14:15:22Z", "sent_at": "2019-08-24T14:15:22Z", "failed_at": "2019-08-24T14:15:22Z", "canceled_at": "2019-08-24T14:15:22Z", "cancellable": true, "retryable": true, "copy_visible": true}