Skip to content

Updated copy and setting for gift redemption staff notification#27769

Merged
sagzy merged 1 commit intomainfrom
gift-susbcriptions/update-staff-notification-on-gift-redemption
May 7, 2026
Merged

Updated copy and setting for gift redemption staff notification#27769
sagzy merged 1 commit intomainfrom
gift-susbcriptions/update-staff-notification-on-gift-redemption

Conversation

@sagzy
Copy link
Copy Markdown
Contributor

@sagzy sagzy commented May 7, 2026

closes https://linear.app/ghost/issue/BER-3616

When a recipient redeems a gift subscription, Ghost sends staff a notification email. Today it reuses the paid subscription started copy and the New paid members email-preference toggle.

We've decided to differentiate the gift redemption staff notification more clearly from the new paid members one. This PR changes the copy of the gift redemption staff notification and moves it under the "Gift subscriptions" email-preference toggle.

Changes

Email copynotifyGiftSubscriptionStarted:

  • Subject: 🎁 Paid subscription started: <name>🎁 Gift subscription redeemed: <name>
  • Headline: You have a new paid subscriberA gift subscription was redeemed
  • Plaintext body line updated to match
  • Preview text updated to match

Notification preference — gift redemptions now go through the existing Gift subscriptions toggle (Stripe + giftSubscriptions feature flag), instead of New paid members:

  • Toggle label: Gift subscription purchasesGift subscriptions
  • Description: Every time someone purchases a gift subscriptionEvery time someone purchases or redeems a gift subscription

Pre-commit hygiene:

  • Added a targeted secretlint-disable-next-line on the random-password-generator default in user.js — the new secret-scanning hook (added in Added secret scanning pre-commit hook #27609) flags password: security.identifier.uid(50) as a credential-assignment false-positive, blocking any future change to this file. The line generates a random password placeholder; it isn't a real credential.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 968671df-2737-4f6b-9ec3-20f9fa8c0bd0

📥 Commits

Reviewing files that changed from the base of the PR and between 7cccb78 and 0e554dc.

📒 Files selected for processing (9)
  • apps/admin-x-settings/src/components/settings/general/users/email-notifications-tab.tsx
  • ghost/core/core/server/models/user.js
  • ghost/core/core/server/services/staff/email-templates/gift.hbs
  • ghost/core/core/server/services/staff/email-templates/gift.txt.js
  • ghost/core/core/server/services/staff/email-templates/new-gift-subscription.hbs
  • ghost/core/core/server/services/staff/email-templates/new-gift-subscription.txt.js
  • ghost/core/core/server/services/staff/staff-service-emails.js
  • ghost/core/test/e2e-api/members/gift-subscriptions.test.js
  • ghost/core/test/unit/server/services/staff/staff-service.test.js
✅ Files skipped from review due to trivial changes (3)
  • ghost/core/core/server/services/staff/email-templates/gift.txt.js
  • ghost/core/core/server/services/staff/email-templates/new-gift-subscription.txt.js
  • ghost/core/core/server/services/staff/email-templates/gift.hbs
🚧 Files skipped from review as they are similar to previous changes (5)
  • apps/admin-x-settings/src/components/settings/general/users/email-notifications-tab.tsx
  • ghost/core/core/server/models/user.js
  • ghost/core/core/server/services/staff/staff-service-emails.js
  • ghost/core/test/e2e-api/members/gift-subscriptions.test.js
  • ghost/core/test/unit/server/services/staff/staff-service.test.js

Walkthrough

This PR consolidates gift subscription email notifications under a unified "gift-subscriptions" alert type in the User model, updates StaffServiceEmails methods to request recipients with that key and to use "Gift subscription redeemed" subject wording, refreshes staff email templates (HTML and text) to use redeemed/purchase-consistent phrasing, updates the admin UI toggle label/hint for gift subscriptions, and aligns unit and e2e tests to the new recipient key and subjects.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: updating gift redemption staff notification copy and its associated email-preference setting.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the specific copy updates and preference setting changes with examples of the before/after messaging.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gift-susbcriptions/update-staff-notification-on-gift-redemption

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.

@sagzy sagzy changed the title 🎨 Reframed gift redemption staff notification Updated copy and setting for gift redemption staff notification May 7, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
ghost/core/core/server/models/user.js (1)

494-497: 💤 Low value

Update stale JSDoc type union for getEmailAlertUsers.

The @param type union lists only 3 of the 8 values the function now handles. This PR adds 'gift-subscriptions' as yet another unrecorded entry.

📝 Proposed JSDoc fix
-* `@param` {'free-signup'|'paid-started'|'paid-canceled'} type The type of alert to fetch users for
+* `@param` {'free-signup'|'paid-started'|'paid-canceled'|'mention-received'|'milestone-received'|'donation'|'recommendation-received'|'gift-subscriptions'} type The type of alert to fetch users for
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ghost/core/core/server/models/user.js` around lines 494 - 497, Update the
JSDoc for getEmailAlertUsers to reflect the full set of alert type string
literals the function actually handles (including 'gift-subscriptions' and the
other values present in the function's logic) by expanding the `@param` union to
include all eight accepted types; ensure the documented union matches the
switch/if branches inside getEmailAlertUsers so the JSDoc accurately describes
allowed inputs and update any related return/description if necessary.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@ghost/core/core/server/models/user.js`:
- Around line 494-497: Update the JSDoc for getEmailAlertUsers to reflect the
full set of alert type string literals the function actually handles (including
'gift-subscriptions' and the other values present in the function's logic) by
expanding the `@param` union to include all eight accepted types; ensure the
documented union matches the switch/if branches inside getEmailAlertUsers so the
JSDoc accurately describes allowed inputs and update any related
return/description if necessary.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f10b7155-2dba-493d-a302-179219862446

📥 Commits

Reviewing files that changed from the base of the PR and between 59b314d and fa3cdc6.

📒 Files selected for processing (6)
  • apps/admin-x-settings/src/components/settings/general/users/email-notifications-tab.tsx
  • ghost/core/core/server/models/user.js
  • ghost/core/core/server/services/staff/email-templates/new-gift-subscription.hbs
  • ghost/core/core/server/services/staff/email-templates/new-gift-subscription.txt.js
  • ghost/core/core/server/services/staff/staff-service-emails.js
  • ghost/core/test/unit/server/services/staff/staff-service.test.js

@sagzy sagzy force-pushed the gift-susbcriptions/update-staff-notification-on-gift-redemption branch 2 times, most recently from 9e5b07a to 7cccb78 Compare May 7, 2026 13:20
- Subject and headline now say "Gift subscription redeemed" instead of
  "Paid subscription started" / "new paid subscriber", so the email
  reads as a gift event rather than a generic paid signup
- Routed the redemption notification through the existing "Gift
  subscriptions" preference (relabelled from "Gift subscription
  purchases", description updated to "Every time someone purchases or
  redeems a gift subscription") so all gift notifications sit behind
  one toggle, instead of redemptions piggybacking on "New paid members"
- Renamed alert type 'gift-subscription-purchased' → 'gift-subscriptions'
  to match the new grouping; DB column gift_subscription_purchase_notification
  is unchanged, so no migration is required
- Added a secretlint-disable-next-line for the random password generator
  default in user.js — the secretlint pattern flags `password: fn(...)`
  as a credential assignment false-positive

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@sagzy sagzy force-pushed the gift-susbcriptions/update-staff-notification-on-gift-redemption branch from 7cccb78 to 0e554dc Compare May 7, 2026 13:29
@sagzy sagzy merged commit 9882356 into main May 7, 2026
43 checks passed
@sagzy sagzy deleted the gift-susbcriptions/update-staff-notification-on-gift-redemption branch May 7, 2026 14:30
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