Quick Start
Here’s how to schedule an email for future delivery:Scheduling Emails
Using ScheduledAt Field
Add theScheduledAt field to your SendEmailRequest with an ISO 8601 formatted datetime:
string
ISO 8601 datetime string (e.g.,
2024-09-05T11:52:01.858Z) specifying when the email should be sent.Must be in the future. The maximum scheduling window may vary - check Resend’s documentation for current limits.Formatting Schedule Times
Use Go’stime package to generate properly formatted ISO 8601 timestamps:
- Relative Time
- Specific Date
- Business Hours
Updating Scheduled Emails
You can reschedule an email before it’s sent:UpdateEmailRequest Fields
string
required
The ID of the scheduled email to update.
string
required
New ISO 8601 datetime for when the email should be sent.
Update Methods
You can only update emails that haven’t been sent yet. Once an email is sent, it cannot be modified.
Canceling Scheduled Emails
Cancel a scheduled email before it’s sent:Cancel Methods
CancelScheduledEmailResponse
string
The ID of the canceled email.
string
Object type, typically
"email".Common Use Cases
Reminder Emails
Reminder Emails
Drip Campaign
Drip Campaign
Scheduled Reports
Scheduled Reports
Canceling on User Action
Canceling on User Action
Scheduling with Templates
You can schedule template-based emails:Scheduling Batch Emails
Schedule multiple emails at once using batch send:Error Handling
Handle errors when scheduling, updating, or canceling emails:Best Practices
1
Use UTC for Scheduling
Always convert to UTC when scheduling to avoid timezone issues:
2
Store Email IDs
Save scheduled email IDs to enable updates or cancellations:
3
Add Scheduling Buffer
Schedule emails with a buffer to account for processing time:
4
Tag Scheduled Emails
Use tags to identify and track scheduled campaigns:
5
Handle Timezone Conversions
When working with user timezones, convert properly:
6
Implement Cancellation Logic
Build logic to cancel scheduled emails when events change:
Time Format Reference
The SDK expects ISO 8601 format (RFC3339). Here are common formatting examples:Always use
time.RFC3339 or a compatible ISO 8601 format. Other formats may be rejected by the API.Next Steps
Sending Emails
Learn the basics of sending emails
Email Templates
Schedule template-based emails
Batch Emails
Schedule multiple emails at once
Attachments
Add attachments to scheduled emails