Schedule Email API

Schedule email notifications for delivery at a specific future time

Email Scheduling

Schedule Email API

Schedule email notifications for future delivery. Perfect for reminders, scheduled announcements, and time-sensitive communications.

Future Delivery

Schedule emails for specific dates and times.

Timezone Aware

Send at optimal times for recipients.

Rich Content

Support for HTML templates and attachments.


Endpoint Overview

MUTATION/graphql

Schedule an email notification for delivery at a specified future time. Supports HTML content, multiple recipients, and timezone handling.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

recipients[String!]!Required

Array of email addresses to send to.

subjectString!Required

Email subject line.

contentString!Required

Email body content (supports HTML).

scheduledTimeDateTime!Required

ISO 8601 datetime for scheduled delivery.

fromNameString

Sender display name.

replyToString

Reply-to email address.

timezoneString

Timezone for scheduled time interpretation.


GraphQL Mutation

mutation scheduleEmail($email: ScheduledEmailInput!) {
  scheduleEmail(email: $email) {
    id
    status
    scheduledTime
    recipients
  }
}

Variables:

{
  "email": {
    "recipients": ["user@example.com", "user2@example.com"],
    "subject": "Subscription Renewal Reminder",
    "content": "<h1>Renewal Reminder</h1><p>Your subscription expires in 7 days.</p>",
    "scheduledTime": "2024-01-20T09:00:00Z",
    "fromName": "OrbVPN Support",
    "replyTo": "support@orbvpn.com"
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation scheduleEmail($email: ScheduledEmailInput!) { scheduleEmail(email: $email) { id status scheduledTime } }",
    "variables": {
      "email": {
        "recipients": ["user@example.com"],
        "subject": "Reminder",
        "content": "Your subscription expires soon.",
        "scheduledTime": "2024-01-20T09:00:00Z"
      }
    }
  }'

Response

200Email Scheduled Successfully
{
  "data": {
    "scheduleEmail": {
      "id": "email_12345",
      "status": "scheduled",
      "scheduledTime": "2024-01-20T09:00:00Z",
      "recipients": ["user@example.com", "user2@example.com"]
    }
  }
}
400Invalid Schedule Time
{
  "errors": [
    {
      "message": "Scheduled time must be in the future",
      "path": ["scheduleEmail"],
      "extensions": {
        "code": "INVALID_SCHEDULE_TIME"
      }
    }
  ],
  "data": null
}

Use Cases

Renewal Reminders

Schedule reminders before subscription expiration.

Promotional Campaigns

Schedule marketing emails for optimal timing.

Time Zone Delivery

Schedule for recipients' local morning hours.

Event Announcements

Schedule announcements for specific launch times.


Best Practices

Optimal Timing

Schedule for business hours in recipient's timezone.

Test First

Send test emails before scheduling large campaigns.

Track Delivery

Monitor scheduled email status and delivery reports.

Unsubscribe Link

Include unsubscribe options for marketing emails.



Timezone Handling

If no timezone is specified, the scheduled time is interpreted as UTC. Always specify the timezone for clarity.

Need Immediate Delivery?

For instant email delivery without scheduling, use the standard notification endpoints.

Notification System