Overview
Sometimes rather than sending a welcome email to new users immediately, it’s nice to delay it. (Some email APIs support this out of the box, but for the sake of this example, let’s assume they don’t.) We’re going to use Resend as our email API, because we’re big fans!Getting your Resend API key
Before we can set up our scheduled email, you’ll need an API key from Resend. Sign up for a free account here: https://resend.com/signupScheduling your welcome email
Once we have our Resend API key, we can send aPOST
request to https://api.resend.com/emails
with the following email parameters:
Don’t forget to pass in your
RESEND_API_KEY
in the Authorization
headeruser.email
in 45 minutes after signing up.
Optional: Ensuring idempotency
Booper also features an option to ensure idempotency, meaning we can set a key that is used to enforce uniqueness. In other words, if we want to send an email to Jane and make sure it’s only sent once, we could set theidempotency_key
to some combination of Jane’s unique ID with the name of the email template (e.g. jane.welcome
) to force any future scheduled emails with the same idempotency_key
to be ignored.