In this section we'll dive into more detail how to expose more extensive information about member plan prices, members themselves and member subscriptions within handlebars templates. To get a cursory view of @member and how to use it in templates take a look at our Members Content visibility section.

The @price object

The @price helper exposes both monthly and yearly with the conveniently named @price.monthly and @price.yearly respectively. A common use case would be to output the prices for member plans within the subscription plan buttons:

<button role="link" data-members-plan="Monthly">
  Sign up for {{@price.monthly}} a month
</button>

<button role="link" data-members-plan="Yearly">
  Sign up for {{@price.yearly}} a year
</button>

The @member object

The @member helper comes with a series of attributes that expose all the information required to create a unique experience for all members of your Ghost site.

Member attributes

  • @member – The member object, returns true or false if the viewer is a member or not
  • @member.paid – The member's payment status, returns true or false if the member has paid
  • @member.email – The member's email address
  • @member.name – The member's full name
  • @member.firstname – The member's first name. String created from everything before the first whitespace in the member's full name

Member subscriptions

As well as member information, it's also possible to get information about a member's subscription. This is data comes from integration with Stripe, to find out more about how to integrate with Stripe check out our Members Docs. @member.subscriptions is useful for showing your audience their payment status, plans and what they're paying.

Because of the possibility that a single member could have multiple subscriptions the data is provided as an array. Subscription data can be exposed using a #foreach like so:

{{#foreach @member.subscriptions}}

  <p>Name: <strong>{{customer.name}}</strong></p>

  <p>Plan type: <strong>{{plan.nickname}}</strong></p>

  <p>Status: <strong>{{status}}</strong></p>

{{/foreach}}

Subscription attributes

Subscription data comes from Stripe meaning a valid Stripe account is required. Check out our documentation on connecting your Stripe account Using subscription data in a local environment will require the Stripe CLI tool, please refer to the official Stripe documentation for more info.

Member subscriptions comes with a verbose list of attributed data:

  • id – The Stripe ID of the subscription
  • customer.id – The Stripe ID of the customer
  • customer.name – The name of the customer in Stripe
  • customer.email – The email of the customer in Stripe
  • plan.id – The Stripe ID of the plan
  • plan.nickname – The Stripe nickname of the plan (currently only "Monthly" or "Yearly")
  • plan.interval – The Stripe plan payment interval (currently only "month" or "year")
  • plan.currency – The currency code of the Stripe plan as an ISO currency code (currently only "USD")
  • 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 "active" or "trialing")
  • start_date – The date which the subscription was first started
  • default_payment_card_last4 – The last 4 digits of the card that paid the subscription
  • current_period_end – The date which the subscription has been paid up until

Note that both start_date and current_period_end can be used in conjunction with the {{date}} helper