Skip to content

Switched dev:mailgun script to use Mailgun API instead of SMTP#29145

Merged
cmraible merged 1 commit into
mainfrom
codex/switch-devmailgun-to-api
Jul 7, 2026
Merged

Switched dev:mailgun script to use Mailgun API instead of SMTP#29145
cmraible merged 1 commit into
mainfrom
codex/switch-devmailgun-to-api

Conversation

@cmraible

@cmraible cmraible commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

closes https://linear.app/ghost/issue/NY-1408/ensure-automation-emails-are-sent-via-the-mailgun-api-in-production

Summary

  • Currently with regular pnpm dev, automation emails are sent to Mailpit. This is fine for the current features, but now that we're working on adding email analytics for automation emails, we need to start using the Mailgun API to send these. This is already how Ghost is configured on Ghost(Pro), but it's currently somewhat tricky to mimic this config locally.
  • The existing pnpm dev:mailgun setup is almost there, but it uses Mailgun via SMTP, which doesn't pass along the tags and other metadata needed for automations email analytics.
  • This updates the pnpm dev:mailgun command to use the Mailgun API (transport = mailgun) for newsletters, transactional emails, and automation emails alike, which also aligns with how mail is configured on Ghost(Pro)

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f8a1080b-b86e-4d26-8b93-63344ccb6570

📥 Commits

Reviewing files that changed from the base of the PR and between 70c9e2f and 0535cdd.

📒 Files selected for processing (2)
  • .env.example
  • compose.dev.mailgun.yaml

Walkthrough

This change updates the development environment configuration for Mailgun email delivery, switching from SMTP-based transport to Mailgun's API-based transport. The .env.example file replaces Mailgun SMTP credential variables with API credential variables (domain, from address, API key, API URL, base URL). The compose.dev.mailgun.yaml docker compose file updates the Ghost dev service environment to use the mailgun mail transport with corresponding API configuration and bulk email delivery settings.

Changes

File Change Summary
.env.example Removed MAILGUN_SMTP_USER/MAILGUN_SMTP_PASS; added MAILGUN_DOMAIN, MAILGUN_FROM, MAILGUN_API_KEY, MAILGUN_API_URL, MAILGUN_BASE_URL with updated comments
compose.dev.mailgun.yaml Switched Ghost mail transport from SMTP to mailgun, wiring API URL/key/domain and bulk email delivery settings

Related Issues: None mentioned.

Related PRs: None mentioned.

Suggested labels: configuration, mailgun, dev-environment

Suggested reviewers: None specified.

Poem

A rabbit hops from SMTP's den,
To API keys, and starts again,
Domains and tokens now line the trail,
Mailgun letters no longer need mail's old rail,
Hop, hop — the dev env's fresh terrain!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/switch-devmailgun-to-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 0535cdd

Command Status Duration Result
nx run @tryghost/admin:build ✅ Succeeded 5s View ↗
nx run ghost:build:assets ✅ Succeeded 2s View ↗
nx run-many -t lint -p ghost-monorepo ✅ Succeeded <1s View ↗
nx run ghost:build:tsc ✅ Succeeded 6s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-07 15:26:03 UTC

@cmraible cmraible force-pushed the codex/switch-devmailgun-to-api branch from 35e938e to 89fff43 Compare July 6, 2026 21:39
@cmraible cmraible changed the title Switched dev Mailgun setup to the Mailgun API Switched dev:mailgun script to use Mailgun API instead of SMTP Jul 6, 2026
@cmraible cmraible force-pushed the codex/switch-devmailgun-to-api branch from 89fff43 to 0535cdd Compare July 7, 2026 15:23
@cmraible cmraible marked this pull request as ready for review July 7, 2026 16:22
@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@cmraible cmraible requested a review from 9larsons July 7, 2026 16:22
@cmraible cmraible merged commit 07cf5d5 into main Jul 7, 2026
40 of 41 checks passed
@cmraible cmraible deleted the codex/switch-devmailgun-to-api branch July 7, 2026 16:25
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.

1 participant