serge-pro-dev

email queue

by serge-pro-dev
payload-plugins
Jobs & automation
v4
^4.0.0-beta.12
MIT

Overview

Summary generated from the README

Moves the emails sent by the Payload form builder plugin into Payload Jobs. It hooks into the form builder's beforeEmail option and registers a job task, so nothing in node_modules is patched. Queue mode needs a job runner and a database migration; the default sync mode leaves the form builder unchanged. Built for Payload 4 beta.

Features

  • Turns each form builder email into one sendFormEmail job
  • Retries failed emails without repeating ones already sent
  • Uses the form builder beforeEmail option without patching dependencies
  • Switches between sync and queue delivery through a delivery option
  • Falls back to direct sending and logs an error if queuing fails
  • Configurable Payload Jobs queue name

Use cases

  • Stop form visitors from waiting on SMTP when they submit a form
  • Retry form notification emails that fail because of temporary mail server errors

From the author

Moves Payload CMS 4 form builder emails into Payload Jobs so the visitor does not wait for SMTP and failures are retried.

Installation

npm i @serge-pro-dev/payload-plugin-email-queue

0

Stars

0

Forks

0

Open Issues

Yesterday

Last Updated

466

Weekly Downloads

v0.1.0-beta.1

npm Version

16.6 KB

Unpacked Size

1

Dependencies

Repository stars

00 since Nov 29

Show data
Repository stars by day (UTC)
DateStars
Dec 6, 20260
Dec 5, 20260
Dec 4, 20260
Dec 3, 20260
Dec 2, 20260
Dec 1, 20260
Nov 30, 20260
Nov 29, 20260

Shared by 6 plugins in serge-pro-dev/payload-plugins.

npm weekly downloads

Trends appear after 7 days of data. Collecting since Dec 4 — 3 daily snapshots so far.

Each point is npm's rolling 7-day download count.

Health Score

78/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1479182369-email-queue.svg)](https://payloaddirectory.dev/plugins/1479182369-email-queue)
HTML
<a href="https://payloaddirectory.dev/plugins/1479182369-email-queue"><img src="https://payloaddirectory.dev/badge/1479182369-email-queue.svg" alt="Payload Directory"></a>
Updated Dec 4, 2026Created Dec 1, 2026Published Dec 3, 2026

README

@serge-pro-dev/payload-plugin-email-queue

Русская версия

Moves the emails of the Payload CMS 4 form builder plugin into Payload Jobs.

The form builder sends its emails inside the request that creates the submission: the visitor waits for SMTP and a failure is only logged. With this plugin each email becomes a job, the visitor gets an immediate answer and failed emails are retried. Nothing in node_modules is patched, the plugin uses the form builder's own beforeEmail option.

Install

pnpm add @serge-pro-dev/payload-plugin-email-queue
import { formBuilderPlugin } from '@payloadcms/plugin-form-builder'
import { resolveDeliveryMode } from '@serge-pro-dev/payload-plugins-shared/delivery'
import {
  createQueueBeforeEmail,
  emailQueuePlugin,
} from '@serge-pro-dev/payload-plugin-email-queue'

// FORM_DELIVERY=queue turns it on, the default ("sync") changes nothing.
const delivery = resolveDeliveryMode(process.env.FORM_DELIVERY)

plugins: [
  formBuilderPlugin({ beforeEmail: createQueueBeforeEmail({ delivery }) }),
  emailQueuePlugin({ delivery }),
]

resolveDeliveryMode comes from @serge-pro-dev/payload-plugins-shared, which is installed automatically with the plugin.

How it works

  • sync (default): the plugin does nothing, the form builder behaves as usual.
  • queue: every email is queued as one job (sendFormEmail), so a retry never repeats an email that was already sent. Emails that could not be queued (for example the migration was not applied) are sent directly and an error is logged.

Queue mode needs a job runner and a database migration, see delivery. Email jobs contain the email text; completed jobs are deleted by Payload, failed ones stay in payload-jobs.

Options

OptionPurpose
delivery'sync' (default) or 'queue'
queuePayload Jobs queue name, default default

MIT

Similar plugins