🎨 Changed email verification error messages to be configurable via hostSettings#26631
Conversation
WalkthroughThis pull request implements configurable error messages for email verification workflows across the email and publishing systems. A new error code 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can generate a title for your PR based on the changes with custom instructions.Set the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26631 +/- ##
=======================================
Coverage 73.09% 73.10%
=======================================
Files 1535 1535
Lines 121261 121268 +7
Branches 14648 14649 +1
=======================================
+ Hits 88641 88647 +6
+ Misses 31613 31593 -20
- Partials 1007 1028 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@JohnONolan any chance we could get a review on this? |
9larsons
left a comment
There was a problem hiding this comment.
A more general comment: I'd love for us to define the available hostSettings (and more generally, our config options) somewhere. The fact that this is totally ambiguous is troublesome and hard to reason about.
I think I'd like to see a more generic pattern for passing the messages, although the DI pattern is the right one. Perhaps something like hostSettings.messages.emailVerification.<items>?
Then DI would/could still pass in hostSettings.messages.emailVerification, or if we use other hostSettings/config, the more broad item that's appropriate.
| emailAnalyticsJobs, | ||
| domainWarmingService | ||
| domainWarmingService, | ||
| emailSendingDisabledMessage: configService.get('hostSettings:emailVerification:emailSendingDisabledMessage') |
There was a problem hiding this comment.
I dislike passing a message through the wrapper vs passing config, as this feels too 'low level' and an anti pattern if we were to have several messages.
There was a problem hiding this comment.
Good point! Switched to passing the full config service via DI, same pattern as DomainWarmingService.
| amountTriggered: amount | ||
| }); | ||
|
|
||
| if (throwOnTrigger) { |
There was a problem hiding this comment.
Currently, aside from tests, we have no callers that pass throwOnTrigger = true. This would then be dead code. Could you let me know why you updated this path?
There was a problem hiding this comment.
You're right! Reverted it back.
…stSettings Pass config service to EmailService via DI (matching DomainWarmingService pattern) instead of threading resolved message strings through the wrapper. Removed dead configurable message from VerificationTrigger's throwOnTrigger path — no production callers use throwOnTrigger = true.
af205f3 to
abed0b6
Compare
9larsons
left a comment
There was a problem hiding this comment.
Super clean! I am annoyed we pass config: configService, as I think simply passing configService is more clear... but we do this almost everywhere in core so it's better to be consistent.
…#120) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/sredevopsorg/ghost-on-kubernetes](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes) | minor | `v6.19.3` → `v6.22.1` | --- ### Release Notes <details> <summary>sredevopsorg/ghost-on-kubernetes (ghcr.io/sredevopsorg/ghost-on-kubernetes)</summary> ### [`v6.22.1`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/releases/tag/v6.22.1) [Compare Source](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/compare/v6.22.0...v6.22.1) #### What's Changed - Update event types for GHOST\_VERSION setup by [@​ngeorger](https://redirect.github.com/ngeorger) in [#​676](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/676) - Add Trivy vulnerability scanner workflow by [@​ngeorger](https://redirect.github.com/ngeorger) in [#​677](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/677) - chore(deps): update actions/checkout action to v6 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​679](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/679) - chore(deps): update aquasecurity/trivy-action action to v0.35.0 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​678](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/678) - chore(deps): update node.js to [`2365189`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/2365189) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​682](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/682) - chore(deps): update step-security/harden-runner action to v2.16.0 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​681](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/681) - chore(deps): update github/codeql-action action to v4.34.1 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​680](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/680) **Full Changelog**: <sredevopsorg/ghost-on-kubernetes@v6.22.0...v6.22.1> #### From upstream [@​tryghost](https://redirect.github.com/tryghost) 🔒 Added file type validation and content-type control for file uploads ([TryGhost/Ghost#26869](https://redirect.github.com/TryGhost/Ghost/pull/26869)) - Princi Vershwal 🎨 Updated Source to v1.5.2 - Ghost CI 🎨 Updated Casper to v5.10.1 - Ghost CI 🎨 Updated private page access and signup flow ([TryGhost/Ghost#26762](https://redirect.github.com/TryGhost/Ghost/pull/26762)) - John O'Nolan 🎨 Changed email verification error messages to be configurable via hostSettings ([TryGhost/Ghost#26631](https://redirect.github.com/TryGhost/Ghost/pull/26631)) - Jannis Fedoruk-Betschki 🐛 Fixed font rendering when converting SVGs with text elements to PNG format ([TryGhost/Ghost#26863](https://redirect.github.com/TryGhost/Ghost/pull/26863)) - Chris Raible 🐛 Fixed "labels is not defined" error when creating comped members via API ([TryGhost/Ghost#26837](https://redirect.github.com/TryGhost/Ghost/pull/26837)) - Troy Ciesco 🐛 Fixed translations for Inbox Links button ([TryGhost/Ghost#26839](https://redirect.github.com/TryGhost/Ghost/pull/26839)) - Evan Hahn 🐛 Fixed domain warming when warming has completed ([TryGhost/Ghost#26817](https://redirect.github.com/TryGhost/Ghost/pull/26817)) - Sam Lord 🌐 Added missed string wrapping for Portal's offer page ([TryGhost/Ghost#26884](https://redirect.github.com/TryGhost/Ghost/pull/26884)) - Cathy Sarisky 🌐 Added new Chinese language strings ([TryGhost/Ghost#26871](https://redirect.github.com/TryGhost/Ghost/pull/26871)) - tommywong-theinitium View the changelog for full details: <TryGhost/Ghost@v6.22.0...v6.22.1> ### [`v6.22.0`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/releases/tag/v6.22.0) [Compare Source](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/compare/v6.21.2...v6.22.0) #### What's Changed - Enhance CI workflow with Dockerfile-docker checks by [@​ngeorger](https://redirect.github.com/ngeorger) in [#​669](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/669) - ci: Automate building new '-docker' releases when there's a release. by [@​markstos](https://redirect.github.com/markstos) in [#​639](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/639) - Wf triggers fixes by [@​ngeorger](https://redirect.github.com/ngeorger) in [#​670](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/670) - fix(check-ghost-releases): use GitHub Packages API for LAST\_BUILT by [@​markstos](https://redirect.github.com/markstos) in [#​671](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/671) - chore(deps): update gcr.io/distroless/nodejs22-debian13:latest docker digest to [`b2a1685`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/b2a1685) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​673](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/673) - chore(deps): update gcr.io/distroless/nodejs22-debian13:debug-nonroot docker digest to [`6731730`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/6731730) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​672](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/672) - Wf patch logic by [@​ngeorger](https://redirect.github.com/ngeorger) in [#​674](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/674) **Full Changelog**: <sredevopsorg/ghost-on-kubernetes@v6.21.2...v6.22.0> ### [`v6.21.2`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/releases/tag/v6.21.2) [Compare Source](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/compare/v6.21.0...v6.21.2) #### What's Changed - ✨ Add healthcheck to Dockerfile. by [@​markstos](https://redirect.github.com/markstos) in [#​655](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/655) - Update base image to specific SHA for runtime by [@​ngeorger](https://redirect.github.com/ngeorger) in [#​665](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/665) - chore(deps): update sigstore/cosign-installer action to v4.1.0 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​666](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/666) - chore(deps): update actions/download-artifact action to v8.0.1 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​667](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/667) **Full Changelog**: <sredevopsorg/ghost-on-kubernetes@v6.21.0...v6.21.2> ### [`v6.21.0`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/releases/tag/v6.21.0) [Compare Source](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/compare/v6.20.0...v6.21.0) #### What's Changed - chore: update Ghost and MySQL user IDs to 65532 for non-root executio… by [@​ngeorger](https://redirect.github.com/ngeorger) in [#​652](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/652) - chore(deps): update docker/login-action action to v4 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​653](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/653) - ✨ Add jemalloc to reduce memory consumption by [@​markstos](https://redirect.github.com/markstos) in [#​654](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/654) - chore(deps): update docker/setup-buildx-action action to v4 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​656](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/656) - chore(deps): update docker/metadata-action action to v6 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​663](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/663) - chore(deps): update docker/build-push-action action to v7 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​662](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/662) - chore(deps): update step-security/harden-runner action to v2.15.1 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​661](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/661) - chore(deps): update github/codeql-action action to v4.32.6 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​660](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/660) - chore(deps): update node.js to [`30c0fec`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/30c0fec) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​659](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/659) - chore(deps): update gcr.io/distroless/nodejs22-debian13:latest docker digest to [`b9b6d4a`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/b9b6d4a) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​658](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/658) - chore(deps): update gcr.io/distroless/nodejs22-debian13:debug-nonroot docker digest to [`9bc6ba5`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/9bc6ba5) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​657](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/657) #### From upstream [@​tryghost](https://redirect.github.com/tryghost) ✨ Expanded available cards in welcome email editor ([TryGhost/Ghost#26645](https://redirect.github.com/TryGhost/Ghost/pull/26645)) - Evan Hahn 🐛 Fixed double-prefixed asset URLs when using CDN - Rob Lester 🐛 Fixed contributor user menu Posts link navigating to wrong route ([TryGhost/Ghost#26716](https://redirect.github.com/TryGhost/Ghost/pull/26716)) - Kevin Ansfield 🐛 Fixed contributor posts list not being scrollable ([TryGhost/Ghost#26715](https://redirect.github.com/TryGhost/Ghost/pull/26715)) - Kevin Ansfield 🐛 Fixed missing server-side label search in recipient & segment selects ([TryGhost/Ghost#26699](https://redirect.github.com/TryGhost/Ghost/pull/26699)) - Kevin Ansfield 🐛 Fixed #-prefixed member label select ordering when scrolling ([TryGhost/Ghost#26702](https://redirect.github.com/TryGhost/Ghost/pull/26702)) - Kevin Ansfield **Full Changelog**: <sredevopsorg/ghost-on-kubernetes@v6.20.0...v6.21.0> ### [`v6.20.0`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/releases/tag/v6.20.0) #### What's Changed - chore(deps): update github/codeql-action action to v4.32.3 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​630](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/630) - chore(deps): update docker/build-push-action action to v6.19.2 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​629](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/629) - docs: Document Dockerfile-docker.dockerfile by [@​markstos](https://redirect.github.com/markstos) in [#​638](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/638) - chore(deps): update actions/dependency-review-action action to v4.8.3 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​641](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/641) - chore(deps): update github/codeql-action action to v4.32.4 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​642](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/642) - chore(deps): update gcr.io/distroless/nodejs22-debian13:latest docker digest to [`72d4913`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/72d4913) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​647](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/647) - chore(deps): update node.js to [`b597724`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/b597724) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​644](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/644) - chore(deps): update gcr.io/distroless/nodejs22-debian13:debug-nonroot docker digest to [`874d16e`](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/commit/874d16e) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​646](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/646) - chore(deps): update github artifact actions (major) by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​648](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/648) - chore(deps): update step-security/harden-runner action to v2.15.0 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​645](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/645) - chore(deps): update actions/dependency-review-action action to v4.9.0 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​650](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/650) - chore(deps): update github/codeql-action action to v4.32.5 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [#​649](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/649) #### New Contributors - [@​markstos](https://redirect.github.com/markstos) made their first contribution in [#​638](https://redirect.github.com/sredevopsorg/ghost-on-kubernetes/pull/638) **Full Changelog**: <sredevopsorg/ghost-on-kubernetes@v6.19.1...v6.20.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/mwgustin/homeops). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My40OC4xIiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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:
Please check your PR against these items:
We appreciate your contribution! 🙏