Introducing the Schedule Email API

Send emails at a specific time without additional complexity.

Felipe VolponeFelipe Volpone
Introducing the Schedule Email API

While some emails need to be delivered as soon as possible, like password resets or magic links, others can be scheduled for a specific time.

Here are some examples of when you might want to schedule an email:

  • Send welcome email 5 minutes after signup
  • Trigger a reminder email 24 hours before an event
  • Schedule a weekly digest email for the next day at 9am PST

Before, you had to use external services to handle the scheduling logic, but now you can use the new Resend API to schedule emails.

Schedule an email

You can use the various Resend SDKs to schedule emails.

import { Resend } from 'resend';
const resend = new Resend('re_123456789');
const oneMinuteFromNow = new Date(Date.now() + 1000 * 60).toISOString();
await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'hello world',
html: '<p>it works!</p>',
scheduledAt: oneMinuteFromNow,
});

The date must be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).

Emails can be scheduled up to 72 hours in advance.

Once you schedule an email, you can see the scheduled time in the Resend dashboard.

Reschedule an email

After scheduling an email, you might need to update the scheduled time.

You can do so with the following method:

const oneMinuteFromNow = new Date(Date.now() + 1000 * 60).toISOString();
resend.emails.update({
id: '49a3999c-0ce1-4ea6-ab68-afcd6dc2e794',
scheduledAt: oneMinuteFromNow,
});

You can also reschedule an email directly in the Resend dashboard.

Cancel a scheduled email

If you need to cancel a scheduled email, you can do so with the following code:

resend.emails.cancel('49a3999c-0ce1-4ea6-ab68-afcd6dc2e794');
Once an email is canceled, it cannot be rescheduled.

You can also cancel a scheduled email in the Resend dashboard.

Limitations

There are some limitations to keep in mind when scheduling emails:

  • Batch emails cannot be scheduled
  • Emails sent via SMTP cannot be scheduled
  • Emails with attachments cannot be scheduled

Get started

We hope this new endpoint makes it easier for you to schedule emails in your application without having to introduce additional complexity.

You can see the Resend OpenAPI spec or the Postman collection for all parameters.

Feel free to check the documentation for more details.