Skip to content

feat: add Worker Mailer SMTP plugin#406

Open
RibasSu wants to merge 20 commits intoemdash-cms:mainfrom
RibasSu:feat/worker-mailer-plugin
Open

feat: add Worker Mailer SMTP plugin#406
RibasSu wants to merge 20 commits intoemdash-cms:mainfrom
RibasSu:feat/worker-mailer-plugin

Conversation

@RibasSu
Copy link
Copy Markdown

@RibasSu RibasSu commented Apr 9, 2026

What does this PR do?

Adds a separate SMTP provider plugin for EmDash using @workermailer/smtp, following the provider-per-plugin direction discussed in #245.

This PR:

  • adds @emdash-cms/plugin-worker-mailer
  • integrates the plugin with EmDash's email:deliver / email:provide flow
  • implements the plugin as a standard isolated plugin configured through Block Kit
  • uses secure SMTP from the start over implicit TLS / SMTPS, which matches Cloudflare Workers' constraints
  • removes the older native/options-driven shape from the plugin API and docs
  • expands plugin tests to cover install defaults, legacy cleanup, config validation, delivery behavior, and Block Kit
    settings
  • updates the Cloudflare demo and package docs for the isolated plugin flow
  • includes a changeset for the published package

Related Discussion: #245

Closes #

Type of change

  • Bug fix
  • Feature (requires approved Discussion)
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code

Screenshots / test output

Validation run for this change:

  • pnpm --filter @emdash-cms/plugin-worker-mailer test
  • pnpm --filter @emdash-cms/plugin-worker-mailer typecheck
  • pnpm --filter @emdash-cms/plugin-worker-mailer build
  • pnpm run --filter @emdash-cms/demo-cloudflare typecheck
  • pnpm --filter @emdash-cms/admin build
  • pnpm --filter @emdash-cms/demo-cloudflare build
  • pnpm typecheck
  • pnpm --silent lint:json | jq '.diagnostics | length'
  • pnpm test

Notes:

  • pnpm --silent lint:json | jq '.diagnostics | length' returns 2, both preexisting warnings:
    • packages/admin/vitest.config.ts
    • packages/core/src/astro/integration/vite-config.ts
  • pnpm test fails in existing core auth tests that expect /_emdash/api/... but currently receive /api/...:
    • packages/core/tests/unit/auth/invite.test.ts
    • packages/core/tests/unit/auth/magic-link.test.ts
    • packages/core/tests/unit/auth/signup.test.ts

These failures are unrelated to the Worker Mailer plugin.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Scope check

This PR changes 596 lines across 12 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 813f27a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@emdash-cms/plugin-worker-mailer Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

RibasSu and others added 5 commits April 9, 2026 11:56
While testing I first implemented this as a native, options-driven plugin in plugins: []. After the guidance in Discussions emdash-cms#245, this now follows the standard isolated Block Kit path in sandboxed: [].

This also removes the older shape from the plugin docs/comments and requires SMTP connections to start secure over implicit TLS instead of upgrading from plaintext.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant