Skip to content

Documented new subscription data in theme members page#49

Draft
minimaluminium wants to merge 2 commits intomainfrom
add-new-subscription-data-helpers-BER-3386
Draft

Documented new subscription data in theme members page#49
minimaluminium wants to merge 2 commits intomainfrom
add-new-subscription-data-helpers-BER-3386

Conversation

@minimaluminium
Copy link
Member

ref https://linear.app/ghost/issue/BER-3386/document-new-subscription-data-and-helpers-in-theme-docs

  • Adds cancel_at_period_end, tier, next_payment, offer, and offer_redemptions to the subscription attributes list
  • Adds a "Next payment" section with examples for displaying the next charge amount and active discounts
  • Adds an "Offers" section with examples for displaying offer information
  • The next_payment docs reflect the simplified discount.end behavior from BER-3466, where theme devs can check for an end date directly without matching on the discount duration type

Added documentation for next_payment object, tier, offer, offer_redemptions,
and cancel_at_period_end to the members theme docs page
@mintlify
Copy link
Contributor

mintlify bot commented Mar 25, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Ghost 🟢 Ready View Preview Mar 25, 2026, 6:44 AM

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

Walkthrough

Documentation for @member.subscriptions in themes/members.mdx was expanded with Stripe-derived subscription fields: cancel_at_period_end; tier metadata (tier.name, tier.description); a next_payment object (amount, original_amount, interval, currency, discount) with guidance to guard for null on inactive subscriptions; discount sub-properties (end, type, amount, duration, duration_in_months); and an Offers section showing offer, offer_redemptions, offer.display_title, and expanded offer properties (display_title, display_description, type, amount, duration, cadence).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: documenting new subscription data fields in the theme members documentation page.
Description check ✅ Passed The description is directly related to the changeset, providing specific details about which subscription attributes were added and what documentation sections were created.
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
  • Commit unit tests in branch add-new-subscription-data-helpers-BER-3386

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.

Copy link
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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@themes/members.mdx`:
- Line 477: The sentence listing offer properties incorrectly includes "trial"
as an offer type; update the enumeration in the line that mentions key offer
properties (the one listing `display_title`, `display_description`, `type`
(`"percent"`, `"fixed"`, or `"trial"`), `amount`, `duration`, and `cadence`) to
remove `"trial"` so `type` only lists `"percent"` and `"fixed"`, and ensure any
adjacent text doesn't imply offer types include trials (leave the "trialing"
subscription status references unchanged).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da5708f9-5683-4328-a7eb-ded41079db30

📥 Commits

Reviewing files that changed from the base of the PR and between 9c3e0f0 and 749c877.

📒 Files selected for processing (1)
  • themes/members.mdx

Copy link

@sagzy sagzy left a comment

Choose a reason for hiding this comment

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

Nice one @minimaluminium! Left a few nits

- `next_payment.interval` – `"month"` or `"year"`
- `next_payment.currency` – ISO currency code, e.g. `"USD"`
- `next_payment.discount` – Active discount details, or `null` when no discount applies
- `offer` – The offer applied when the member subscribed, or `null`
Copy link

Choose a reason for hiding this comment

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

"The offer applied when the member subscribed" → The offer can be either a signup or retention offer, so I think this should be something like "Details of the last offered redeemed on this subscription" (regardless of whether it's a signup or retention offer)

{{/foreach}}
```

When a discount is active, `next_payment.discount` contains details about it. The `discount.end` property returns a date for both one-time and repeating discounts, and `null` for forever discounts — so you can check for an end date directly without inspecting the discount type:
Copy link

Choose a reason for hiding this comment

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

nit: "— so you can check for an end date directly without inspecting the discount type" feels unnecessary, would remove

- `next_payment.original_amount` – Original amount before discounts
- `next_payment.interval` – `"month"` or `"year"`
- `next_payment.currency` – ISO currency code, e.g. `"USD"`
- `next_payment.discount` – Active discount details, or `null` when no discount applies
Copy link

Choose a reason for hiding this comment

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

next_payment first-level properties are listed here (interval, currency, etc.), versus next_payment.discount properties are listed in the "Next payment" section. Might be easier to read if everything is under the "Next payment" section, next to the examples of usage?

@@ -407,7 +407,74 @@ Subscription data comes from Stripe meaning a valid Stripe account connected to
- `status` – The status of the subscription (can be one of: “active”, “trialing”, “unpaid”, “past_due”, “canceled”)
- `start_date` –The date which the subscription was first started, can be used with the `{{date}}` helper
Copy link

Choose a reason for hiding this comment

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

Missing space after em dash

Copy link
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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@themes/members.mdx`:
- Line 408: Update the `start_date` description to remove the redundant wording;
change the phrase "was first started" to simply "started" so the line reads:
"`start_date` – The date the subscription started, can be used with the
`{{date}}` helper", editing the text that references the `start_date` field and
the `{{date}}` helper.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 006ffa02-f460-4070-a871-3cae8dc0a03c

📥 Commits

Reviewing files that changed from the base of the PR and between 749c877 and 8b239bb.

📒 Files selected for processing (1)
  • themes/members.mdx

- `plan.amount` – The amount of the Stripe plan in the smallest currency denomination (e.g. USD \$5 would be “500” cents)
- `status` – The status of the subscription (can be one of: “active”, “trialing”, “unpaid”, “past_due”, “canceled”)
- `start_date` –The date which the subscription was first started, can be used with the `{{date}}` helper
- `start_date` – The date which the subscription was first started, can be used with the `{{date}}` helper
Copy link
Contributor

@coderabbitai coderabbitai bot Mar 25, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Tighten wording on start_date description.

Line 408 uses “was first started,” which is redundant. Suggest simplifying to “started.”

✏️ Proposed doc edit
-- `start_date` – The date which the subscription was first started, can be used with the `{{date}}` helper
+- `start_date` – The date the subscription started, can be used with the `{{date}}` helper
🧰 Tools
🪛 LanguageTool

[style] ~408-~408: This phrase is redundant. Consider writing “started”.
Context: ...– The date which the subscription was first started, can be used with the{{date}}` helper...

(FIRST_BEGAN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@themes/members.mdx` at line 408, Update the `start_date` description to
remove the redundant wording; change the phrase "was first started" to simply
"started" so the line reads: "`start_date` – The date the subscription started,
can be used with the `{{date}}` helper", editing the text that references the
`start_date` field and the `{{date}}` helper.

Copy link
Member Author

Choose a reason for hiding this comment

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

The text was already there before our changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@minimaluminium, you're right — looking at the diff, the only change on that line was adding a space after the dash (formatting), and the wording "was first started" was already present in the original file before this PR. The style suggestion is valid in isolation but is outside the scope of your changes. Would you like me to open a separate follow-up issue to track this wording cleanup, or would you prefer to leave it as-is?

@minimaluminium minimaluminium marked this pull request as draft March 25, 2026 09:07
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