Skip to content

🎨 Changed email verification error messages to be configurable via hostSettings#26631

Open
betschki wants to merge 1 commit intoTryGhost:mainfrom
magicpages:configurable-email-verification-messages
Open

🎨 Changed email verification error messages to be configurable via hostSettings#26631
betschki wants to merge 1 commit intoTryGhost:mainfrom
magicpages:configurable-email-verification-messages

Conversation

@betschki
Copy link
Contributor

Managed hosting providers other than Ghost(Pro) currently see hardcoded "support@ghost.org" and "account is currently in review" messages that don't apply to their platform. This adds hostSettings configuration keys (emailSendingDisabledMessage, emailVerificationNeededMessage) under the existing emailVerification namespace, with the current Ghost(Pro) messages kept as defaults. Also replaced fragile regex-based error detection in publish-limit modal with proper error code checking.

Got some code for us? Awesome 🎊!

Please take a minute to explain the change you're making:

  • Why are you making it?
  • What does it do?
  • Why is this something Ghost users or developers need?

Please check your PR against these items:

  • I've read and followed the Contributor Guide
  • I've explained my change
  • I've written an automated test to prove my change works

We appreciate your contribution! 🙏

…stSettings

Managed hosting providers other than Ghost(Pro) currently see hardcoded
"support@ghost.org" and "account is currently in review" messages that
don't apply to their platform. This adds hostSettings configuration keys
(emailSendingDisabledMessage, emailVerificationNeededMessage) under the
existing emailVerification namespace, with the current Ghost(Pro)
messages kept as defaults. Also replaced fragile regex-based error
detection in publish-limit modal with proper error code checking.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9e74bb and 0f448f6.

📒 Files selected for processing (9)
  • ghost/admin/app/components/modals/limits/publish-limit.js
  • ghost/admin/app/controllers/lexical-editor.js
  • ghost/admin/app/utils/publish-options.js
  • ghost/core/core/server/services/email-service/email-service-wrapper.js
  • ghost/core/core/server/services/email-service/email-service.js
  • ghost/core/core/server/services/members/service.js
  • ghost/core/core/server/services/verification-trigger.js
  • ghost/core/test/unit/server/services/email-service/email-service.test.js
  • ghost/core/test/unit/server/services/verification-trigger.test.js

Walkthrough

This pull request implements configurable error messages for email verification workflows across the email and publishing systems. A new error code EMAIL_VERIFICATION_NEEDED is introduced and threaded through multiple services. The changes allow custom messages for email sending disabled scenarios and email verification needed scenarios to be sourced from host settings configuration, replacing hard-coded defaults. These messages propagate from config through EmailServiceWrapper, EmailService, VerificationTrigger, and ultimately to the PublishLimitModal UI component, which now selects header text based on the error code rather than message content inspection. Test coverage is added for the new verification code paths.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: making email verification error messages configurable via hostSettings, which is the core objective of this PR.
Description check ✅ Passed The description clearly explains the rationale (hardcoded Ghost(Pro) messages don't apply to other managed hosts), the solution (configurable hostSettings keys), and confirms tests were written.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 and usage tips.

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.18%. Comparing base (0e9af45) to head (0f448f6).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ore/server/services/email-service/email-service.js 71.42% 2 Missing ⚠️
ghost/admin/app/utils/publish-options.js 0.00% 1 Missing ⚠️
.../core/core/server/services/verification-trigger.js 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26631      +/-   ##
==========================================
- Coverage   73.19%   73.18%   -0.02%     
==========================================
  Files        1528     1528              
  Lines      120379   120434      +55     
  Branches    14564    14565       +1     
==========================================
+ Hits        88116    88143      +27     
- Misses      31243    31287      +44     
+ Partials     1020     1004      -16     
Flag Coverage Δ
admin-tests 53.77% <0.00%> (+<0.01%) ⬆️
e2e-tests 73.18% <76.47%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JohnONolan JohnONolan self-requested a review March 2, 2026 09:44
Copy link
Member

@JohnONolan JohnONolan left a comment

Choose a reason for hiding this comment

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

Good idea

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.

2 participants