Skip to content

Add a configurable Reply-To to all CMS mails - #288

Merged
Jan0707 merged 2 commits into
mainfrom
mail-reply-to
Oct 21, 2026
Merged

Jan0707 merged 2 commits into
mainfrom
mail-reply-to

Conversation

@claude

@claude claude Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Requested by Richard Hartmann · Slack thread

Before: every mail the CMS sends (ticket confirmations, speaker portal, newsletter, Directus password reset/invites, Flows) goes out from EMAIL_FROM, an address that cannot receive mail. Replies are lost.

After: if EMAIL_REPLY_TO is set, every one of these mails carries it as Reply-To, so replies land in a real inbox.

How

  • New hook mail-reply-to (src/mail-reply-to/index.ts): a filter on email.send, which Directus' MailService.send runs before every mail. It adds replyTo from EMAIL_REPLY_TO (read from the extension context env, like INVOICE_FILES_FOLDER). Directus itself has no env for a default Reply-To.
  • A Reply-To set by the caller is kept. Unset or empty: no filter is registered, nothing changes.
  • No schema changes. Documented in directus-cms/.env.example, docs/tickets.md (Directus env table) and docs/newsletter.md.
  • Tests: Reply-To set (trimmed, message not mutated), caller's Reply-To kept, unset / empty / whitespace registers no filter.

Deployment

  1. Set EMAIL_REPLY_TO=<inbox address> (e.g. podcast@programmier.bar) in the Directus environment.
  2. Deploy / restart Directus.
  3. Send a test mail (e.g. newsletter test send) and check the Reply-To header.

Generated by Claude Code

Mails go out from EMAIL_FROM, which cannot receive replies, and Directus
has no default Reply-To setting. A new `mail-reply-to` filter hook on
`email.send` adds EMAIL_REPLY_TO to every mail sent through the
MailService (bundle mails, newsletter, Directus system mails, Flows).
A Reply-To set by the caller is kept; unset or empty is a no-op.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBHiR6NFRe6QR5SBjSv4nw
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
programmierbar-website Ready Ready Preview Oct 21, 2026 3:14pm UTC

Request Review

Resolve docs/tickets.md env table: keep both the EMAIL_REPLY_TO and the
ACCOUNTING_INVOICE_EMAIL rows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBHiR6NFRe6QR5SBjSv4nw
@Jan0707
Jan0707 marked this pull request as ready for review October 21, 2026 15:28
Copilot AI balanced review requested due to automatic review settings October 21, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrowly scoped implementation matches the documented behavior and includes focused tests, with no blocking issues identified.

No open issues 🎉

What changed in this PR

Adds an optional default Reply-To address across CMS emails so replies can reach a monitored inbox.

Changes:

  • Registers an email.send hook using trimmed EMAIL_REPLY_TO, preserving caller-supplied Reply-To values.
  • Adds tests for configured, overridden, and unset values.
  • Documents configuration and newsletter behavior.
File Description
docs/​tickets.md Documents the optional environment variable.
docs/​newsletter.md Clarifies newsletter Reply-To behavior.
directus-cms/​extensions/​directus-extension-programmierbar-bundle/​src/​mail-reply-to/​index.ts Implements the default Reply-To hook.
directus-cms/​extensions/​directus-extension-programmierbar-bundle/​src/​mail-reply-to/​__tests__/​index.test.ts Tests configuration and caller overrides.
directus-cms/​extensions/​directus-extension-programmierbar-bundle/​package.json Registers the hook in the bundle.
directus-cms/​.env.example Adds configuration guidance and an example.

Review effort: Balanced

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T15:46:33.582348Z d415280 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Jan0707
Jan0707 merged commit bc5fc36 into main Oct 21, 2026
6 checks passed
@Jan0707
Jan0707 deleted the mail-reply-to branch October 21, 2026 15:46

This branch was successfully deployed

1 active deployment
Preview — d415280d Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants