Skip to content
Content
Skill

/mailer-providers

Use when sending Webiny's email through Resend, SendGrid or Amazon SES instead of SMTP, when choosing a mail provider, or when writing a custom mail transport. Triggers on: "use Resend", "use SendGrid", "use SES", "Amazon SES", "replace SMTP", "mail provider", "custom

From plugin
webiny-js
8.1k79 skills3 MCP

Claude Code

$ npx -y skills add webiny/webiny-js --skill mailer-providers --agent claude-code

SKILL.md

mailer-providers.SKILL.md
name: webiny-mailer-providers
description: >
  Use when sending Webiny's email through Resend, SendGrid or Amazon SES instead of SMTP, when
  choosing a mail provider, or when writing a custom mail transport. Triggers on: "use Resend",
  "use SendGrid", "use SES", "Amazon SES", "replace SMTP", "mail provider", "custom transport",
  "ResendMailer", "SendGridMailer", "SesMailer", "MailTransportFactory".

Mail providers: Resend, SendGrid, Amazon SES

TL;DR

Webiny sends its mail (password reset codes, workflow notifications, the test email) through one mail transport. New projects render `<Api.Mailer.Smtp />` in `webiny.config.tsx`. Resend, SendGrid and Amazon SES are extensions: install one with the CLI, then remove `<Api.Mailer.Smtp />`. Each is configured with environment variables that the API reads when it sends mail, so API keys never go into the build.

| Provider | Install | Component | | ---------- | --------------------------------------- | --------------------- | | SMTP | in the project template | `<Api.Mailer.Smtp />` | | Resend | `yarn webiny extension mailer/resend` | `<ResendMailer />` | | SendGrid | `yarn webiny extension mailer/sendgrid` | `<SendGridMailer />` | | Amazon SES | `yarn webiny extension mailer/ses` | `<SesMailer />` |

Installing copies the source into `extensions/mailer/<provider>/` and adds the component to `webiny.config.tsx`. The code is the project's own from then on: it can be read and changed.

Replacing SMTP (`webiny.config.tsx`)

// Before
import { Api } from "webiny/extensions";
<Api.Mailer.Smtp />;

// After `yarn webiny extension mailer/resend`
import { ResendMailer } from "./extensions/mailer/resend/ResendMailer.js";
<ResendMailer />;

Remove `<Api.Mailer.Smtp />` and its import yourself. If both are rendered, the provider is used while it is configured, and SMTP is the fallback.

Environment variables

Variables prefixed with `WEBINY_` are passed to the API functions on deploy, so setting them in the shell or in the project's `.env` file is enough.

Resend

| Variable | Required | Description | | ---------------------------- | -------- | ----------------------------------------------------------------------- | | `WEBINY_API_RESEND_API_KEY` | Yes | Resend API key. A key with "Sending access" is enough. | | `WEBINY_API_RESEND_FROM` | Yes | Sender, e.g. `no-reply@example.com` or `Webiny <no-reply@example.com>`. | | `WEBINY_API_RESEND_REPLY_TO` | No | Reply-to address for mail sent without one. |

The sender must be on a domain verified in Resend.

SendGrid

| Variable | Required | Description | | ------------------------------ | -------- | ----------------------------------------------------------------------- | | `WEBINY_API_SENDGRID_API_KEY` | Yes | SendGrid API key with the "Mail Send" permission. | | `WEBINY_API_SENDGRID_FROM` | Yes | Sender, e.g. `no-reply@example.com` or `Webiny <no-reply@example.com>`. | | `WEBINY_API_SENDGRID_REPLY_TO` | No | Reply-to address for mail sent without one. |

The sender must be a verified Sender Identity in SendGrid.

Amazon SES

| Variable | Required | Description | | ---------------------------------- | -------- | ----------------------------------------------------------------------- | | `WEBINY_API_SES_FROM` | Yes | Sender, e.g. `no-reply@example.com` or `Webiny <no-reply@example.com>`. | | `WEBINY_API_SES_REGION` | No | SES region. Defaults to the region the API runs in. | | `WEBINY_API_SES_REPLY_TO` | No | Reply-to address for mail sent without one. | | `WEBINY_API_SES_CONFIGURATION_SET` | No | SES configuration set, for bounce, complaint and delivery tracking. |

No credentials: on AWS, the deploy adds an `ses:SendEmail` policy for the sender to the API functions' IAM role. In a standalone project, the AWS SDK's default credential chain is used (`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, a profile, an instance role). The sender must be a verified SES identity, and the account needs SES production access to mail unverified addresses.

Writing your own transport

A transport is an API extension that registers a `MailTransportFactory`. `createTransport()` reads the transport's configuration and returns a `MailTransport`, or `null` when it is not configured. The last registered factory that returns a transport is used.

// extensions/mailer/myProvider/api/MyMailTransportFactory.ts
import { MailTransport, MailTransportFactory } from "webiny/api/mailer";

class MyMailTransport implements MailTransport.Interface {
  public readonly name = "Mailer/MyTransport";

  async send(params: MailTransport.SendParams) {
    // Call the provider. Return { result, error: null } or { result: null, error }.
    return { result: null, error: null };
  }
}

class MyMailTransportFactory implements MailTransportFactory.Interface {
  public readonly name = "Mailer/MyTransport";

  async createTransport(): MailTransportFactory.Return {
    if (!process.env.WEBINY_API_MY_PROVIDER_KEY) {
      return null;
    }
    return new MyMailTransport();
  }
}

export default MailTransportFactory.createImplementation({
  implementation: MyMailTransportFactory,
  dependencies: []
});

Register it in `webiny.config.tsx` with `<Api.Extension src={"/extensions/mailer/myProvider/api/MyMailTransportFactory.ts"} />`. The Resend, SendGrid and SES extensions are complete examples.

Settings edited in the Admin app

T

Read more
@webiny
Ships withwebiny-js

Open-source content platform. Self-hosted on AWS serverless. Built as a TypeScript framework you extend with code, not a closed product you configure through a UI. Runs on Lambda, DynamoDB, S3, and CloudFront inside your own AWS account. Scales automatically.

8.1k79 skills3 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
8.1k
Star history of webiny/webiny-js on GitHub, a chart by star-history.com

Other skills on webiny-js.

design-ask

design-ask

Turn open design questions into a paste-ready prompt for Claude Design, log them with Q-IDs and copy the prompt to the clipboard.…

@webiny@webinyInstall Skill
design-pull

design-pull

Pull a Claude Design project into a local, git-ignored design folder and keep a catalogue of what was pulled and implemented. Use…

@webiny@webinyInstall Skill
grill-me

grill-me

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision…

@webiny@webinyInstall Skill
prd-to-plan

prd-to-plan

Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in…

@webiny@webinyInstall Skill
preflight

preflight

Webiny-only. Run all checks required before packages are ready for publish: deps, build, lint, format, tests.

@webiny@webinyInstall Skill
tester

tester

Use when running tests. Shows how to run tests for a single package, including OpenSearch (ddb-os) tests when applicable.

@webiny@webinyInstall Skill

More skills from other plugins.

prompt-lookup

prompt-lookup

Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use…

@gh-f@gh-fInstall Skill
ppt-master

ppt-master

AI-driven presentation workflow for generating editable PPTX decks and slides, reconstructing page visuals, creating reusable…

@hugohe3@hugohe3Install Skill
morph-ppt

morph-ppt

Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style…

@iofficeai@iofficeaiInstall Skill

Questions about mailer-providers.

Which coding agents can use mailer-providers?
mailer-providers installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.