Example tasks
Send a sequence of emails using Resend
This example will show you how to send a sequence of emails over several days using Resend with Trigger.dev.
Overview
Each email is wrapped in retry.onThrow. This will retry the block of code if an error is thrown. This is useful when you don’t want to retry the whole task, but just a part of it. The entire task will use the default retrying, so can also retry.
Additionally this task uses wait.for to wait for a certain amount of time before sending the next email. During the waiting time, the task will be paused and will not consume any resources.
Task code
trigger/email-sequence.ts
Testing your task
To test this task in the dashboard, you can use the following payload:
Was this page helpful?