Schedule EMAIL
Schedule EMAIL sending.
Apart from sending messages in real-time, our API enables you to take control over the message delivery schedule and message status.
Message scheduling:
Message status:
Schedule EMAIL message
https://api.infobip.com/email/1/send
https://api.infobip.com/email/2/send
If you want to schedule your EMAIL to be sent later you can use the sendAt
parameter in the Fully-featured textual message API method. This will set a specific date and time when the message will be sent.
Date and time format for EMAIL scheduling: 2015-07-07T17:00:00.000+01:00
.
The example below shows how to schedule your message:
curl -s --user user:password \
https://{base_url}/email/1/send \
-F from='Jane Doe <jane.doe@somecompany.com>' \
-F to='john.smith@somedomain.com' \
-F subject='Mail subject text' \
-F text='Mail body text' \
-F bulkId='cusotmBulkId'
-F sendAt='2015-07-07T17:00:00.000+01:00'
And here is the response you will receive:
{
"bulkId":"cusotmBulkId",
"messages": [
{
"to": "john.smith@somedomain.com",
"messageCount": 1,
"messageId": "c268350e-c85e-41d1-b5a0-a60771b134bd",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
}
}
]
}
Get message schedule info
http://api.infobip.com/email/1/bulks?bulkId={bulkId}
This method will return information about the scheduled time for a unique bulk message. Canceling and rescheduling is supported.
Request example:
GET /email/1/bulks?bulkId=cusotmBulkId HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Response:
{
"bulkId": "cusotmBulkId",
"sendAt": "2021-08-25T16:00:00.000+0000"
}
Reschedule EMAIL message
http://api.infobip.com/email/1/bulks?bulkId={bulkId}
Messages scheduled with the sendAt
parameter can be paused, resumed or canceled by changing the message status, or rescheduled using the bulkId
parameter as an identifier.
Request example:
PUT /email/1/bulks?bulkId=cusotmBulkId HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
{
"sendAt": "2021-08-25T16:00:00.000+0000"
}
Response:
{
"bulkId": "cusotmBulkId",
"sendAt": "2021-08-26T16:00:00.000+0000"
}
Get message status info
http://api.infobip.com/email/1/bulks/status?bulkId={bulkId}
This method will return the current status of the bulk message.
Request example:
GET /email/1/bulks/status?bulkId=cusotmBulkId HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Response:
{
"bulkId": "cusotmBulkId",
"status": "PENDING"
}
Below is a list of possible message statuses. Only PENDING and PAUSED status can be updated.
Status | Can be updated to |
---|---|
PENDING | PAUSED, CANCELED |
PAUSED | PENDING, CANCELED |
CANCELED | N/A |
PROCESSING | N/A |
FINISHED | N/A |
FAILED | N/A |
Update message status
http://api.infobip.com/email/1/bulks/status?bulkId={bulkId}
Messages scheduled with the sendAt
parameter can be paused, resumed or canceled by changing the message status, or rescheduled using the bulkId
parameter as an identifier. The following statuses can be updated:
Status | Can be updated to |
---|---|
PENDING | PAUSED, CANCELED |
PAUSED | PENDING, CANCELED |
Status update
PENDING and PAUSED statuses can be changed back and forth until the message starts to process (scheduled time is up and message is sent).
Once a message is CANCELED it cannot be rescheduled or updated with a new status! The message will remain undelivered regardless of the scheduled date and time.
Request example:
PUT /email/1/bulks/status?bulkId=cusotmBulkId HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
{
"status": "PAUSED"
}
Response:
{
"bulkId": "cusotmBulkId",
"status": "PAUSED"
}