npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

payload-email-ses

v1.0.1

Published

AWS SESv2 email adapter for Payload CMS 3.x

Readme

payload-email-ses

AWS SESv2 email adapter for Payload CMS 3.x.

Install

pnpm add payload-email-ses

Peer dependencies (@aws-sdk/client-sesv2 and payload) must also be installed:

pnpm add @aws-sdk/client-sesv2 payload

Usage

In your payload.config.ts:

import { buildConfig } from "payload";
import { sesAdapter } from "payload-email-ses";

export default buildConfig({
  email: sesAdapter({
    defaultFromAddress: "[email protected]",
    defaultFromName: "My App",
    region: "eu-west-1",
    credentials: {
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    },
  }),
  // ... rest of your config
});

Configuration

| Option | Type | Required | Description | | ----------------------------- | -------- | -------- | --------------------------------------- | | defaultFromAddress | string | Yes | Default sender email address | | defaultFromName | string | Yes | Default sender display name | | region | string | Yes | AWS region for SES (e.g. eu-west-1) | | credentials.accessKeyId | string | Yes | AWS access key ID | | credentials.secretAccessKey | string | Yes | AWS secret access key | | logger | Logger | No | Structured logger for email send events |

Logging

Pass a Logger to get structured logs for email send events. The logger is completely optional — emails are delivered normally when no logger is provided. Logging failures never affect email delivery.

import { pino } from "pino";

export default buildConfig({
  email: sesAdapter({
    defaultFromAddress: "[email protected]",
    defaultFromName: "My App",
    region: "eu-west-1",
    credentials: {
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    },
    logger: pino(),
  }),
});

The Logger interface matches pino, winston, bunyan, and most Node.js loggers:

interface Logger {
  info: (msg: string, meta?: Record<string, unknown>) => void;
  error: (msg: string, meta?: Record<string, unknown>) => void;
  warn: (msg: string, meta?: Record<string, unknown>) => void;
}

Log events:

| Event | Level | Metadata | | ------------ | ------- | ----------------------------------------- | | Before send | info | to, cc, bcc, from, subject | | Send success | info | messageId | | Send failure | error | errorName, errorMessage, to, from |

Sending emails

await req.payload.sendEmail({
  to: "[email protected]",
  subject: "Welcome",
  html: "<h1>Hello!</h1>",
  text: "Hello!",
});

Override from address per email

await req.payload.sendEmail({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Support",
  html: "<p>We got your message.</p>",
});

Reply-To

await req.payload.sendEmail({
  to: "[email protected]",
  subject: "Contact",
  html: "<p>Reply to this email.</p>",
  replyTo: "[email protected]",
});

AWS IAM permissions

The IAM user or role needs at minimum:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["ses:SendEmail", "ses:SendRawEmail"],
      "Resource": "*"
    }
  ]
}

Exports

  • sesAdapter — Adapter factory function
  • buildFromAddress — Format "Name <email>" helper
  • resolveFromAddress — Resolve from address from various formats
  • mapDestination — Map to/cc/bcc to SESv2 destination
  • mapEmailContent — Map subject/html/text to SESv2 content

Type exports: SESAdapterArgs, SESEmailResponse, SESEmailAdapter, Logger

License

MIT