Перейти к основному содержимому

Schedule Email API

POST /scheduleEmail

Description

This API endpoint allows you to schedule an email to be sent at a specific date and time. This can be useful for planning email campaigns, reminders, or notifications to be sent in the future.

Request Body

The request utilizes GraphQL to perform the scheduleEmail mutation.

Mutation:

mutation scheduleEmail ($scheduleEmailRequest: ScheduleEmailRequest) {
scheduleEmail (scheduleEmailRequest: $scheduleEmailRequest)
}

Variables:

{
"scheduleEmailRequest": {
"email": "<Recipient_Email>",
"subject": "<Email_Subject>",
"body": "<Email_Body>",
"dateTime": "<Scheduled_DateTime>",
"timeZone": "<Time_Zone>"
}
}
  • email (String): The recipient's email address.
  • subject (String): The subject line of the email.
  • body (String): The content or body of the email.
  • dateTime (String): The date and time when the email should be sent, formatted according to ISO 8601 (e.g., "2024-08-20T15:00:00Z").
  • timeZone (String): The time zone in which the scheduled date and time should be interpreted (e.g., "America/New_York").

Response:

  • Success (200 OK):

    • If the email scheduling is successful, the response will indicate that the email has been scheduled.
    {
    "data": {
    "scheduleEmail": true
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with scheduling the email, the response will include an appropriate error message and status code.

Note:

Ensure that all fields are correctly filled and formatted, especially the dateTime and timeZone, to avoid scheduling issues. This API should be used to automate the sending of emails based on predefined schedules.