@workermailer/resend

Resend docs

Queues

Run Resend delivery in the background with the queue helper entry point.

Page options

GitHub update timestamp unavailable.

Resend queues

Queue producer

import { enqueueEmail } from '@workermailer/resend/queue';

await enqueueEmail(env.EMAIL_QUEUE, {
  mailerOptions: {
    apiKey: env.RESEND_API_KEY,
    from: env.RESEND_FROM
  },
  emailOptions: {
    from: 'Acme Alerts <alerts@acme.com>',
    to: 'alice@example.com',
    subject: 'Queued Resend delivery',
    text: 'This send came from Cloudflare Queues.'
  }
});

Queue consumer

import { createQueueHandler } from '@workermailer/resend/queue';

const handler = createQueueHandler({
  onSuccess: (result) => console.log('Delivered', result.emailOptions.subject),
  onError: (result) => console.error('Failed', result.error)
});

export default {
  async queue(batch: MessageBatch<any>) {
    return handler(batch);
  }
};

Behavior

  • successful sends call message.ack()
  • failed sends call message.retry()
  • each result keeps the original emailOptions for downstream logging

Use queues when delivery should happen in the background or when you want retries owned by Cloudflare Queues instead of the request handler.