Skip to content
Docs menu

Guides

Features

API

Integrations

Payload

Send Payload's emails, such as password resets and email verification, through Wakio.

npm install wakio
// payload.config.ts
import { buildConfig } from "payload"
import { wakioAdapter } from "wakio/payload"

export default buildConfig({
  email: wakioAdapter({
    defaultFromAddress: "[email protected]",
    defaultFromName: "Acme",
  }),
})

defaultFromAddress must be on one of your sending domains. The adapter reads WAKIO_API_KEY when it sends.

When you call payload.sendEmail yourself:

  • Give to, cc and bcc as an address, a named address like Maya Lee <[email protected]>, a { name, address } object, or a list of them. Put a name that contains a comma in double quotes. Give replyTo as a bare address: Wakio refuses a name there.
  • Give attachments their content and a contentType. A file given by path is refused with an error naming it, because the adapter does not read your disk.
  • Set an X-Wakio-Idempotency-Key header to make a send idempotent. Wakio removes the header before sending; any other custom header is refused.

If every address is suppressed, sendEmail throws WakioSuppressedError.

Templates are set up with Wakio for now: email [email protected].