Email Templates

Chargify lets you customize emails for specific events that take place within a subscription’s lifetime. To get you started, we provide default templates for each of these emails. You’re free to edit them to fit your needs with the dynamic variables below. We expose these variables for you to use in each email template. Variables must be quoted in double braces, such as {{product.name}}.

The syntax used in the email templates is called “Liquid”. The Liquid for Designers wiki page provides a good overview and many examples, including If / Else for conditional logic.

Liquid Examples

Chargify has compiled a number of liquid examples that merchants can select from when creating email templates. You may locate them here.

These templates are incredibly helpful if you’d like to construct emails of the following nature:

If you have a suggestion for the example page, please let us know!

If you'd like to revert to the original email templates associated with your site, please use the resource at the bottom of this page. We've published a collection of email templates as a backup for your sites. Please see the linked section of the documentation for more information.

Legacy fields

  • {{return_url}} Do not use
  • {{product.return_url}} Do not use
  • {{product.return_params}} Do not use

Basic Fields

Email Field Description
{{from_address}} This will be replaced with acme-inc@example.com if left as {{from_address}} though any valid email address will do.
{{name}} The name of your customer. e.g. Bill Williams
{{full_name}} The name of your customer. e.g. Bill Williams
{{product_price}} The recurring price of the subscription’s current product
{{product_name}} The name of the product. e.g. Basic Plan
{{product_family}} The name of the product family e.g. Wonderful Products
{{product_family_and_name}} The product family name surrounded by parenthesis, followed by the product name. e.g. (Wonderful Product Family) Basic Plan
{{balance_in_cents}} The amount, if any, they still owe. e.g. 0 (for $0.00) or 23100 (for $231.00) Useful for conditionally adding a reminder.
{{balance}} the amount, if any, they still owe in dollars. e.
{{merchant_name}} Your merchant name. e.g. Acme, Inc.
{{masked_card_number}} The masked credit card number. eg XXXX-XXXX-XXXX-1
{{update_url}} The self-service URL for the subscription

Billing Portal

You can inform your subscribers via email of the direct links needed to perform certain tasks in the Billing Portal. Use the following URLS in any of the emails, under settings, to link a subscriber to a specific location to perform any of the tasks below. Please be aware that you must have the Billing Portal enabled in order to create valid URLs.

Cancel my account

https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/cancel

Configure your plan

https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/components

Plan change

https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/migrations/new

Update payment method

https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/payment_method/edit

View my account

https://www.billingportal.com/s/[your_subdomain]/accounts/{{customer.id}}/edit

Custom Fields (Metadata)

Custom fields can be accessed in email templates with a Liquid filter:

{{ subscription | custom_field: "Color" }}

where “Color” is the name of the custom field.

Custom field values can be used in conditionals by capturing the filtered value as a named variable and then using it later:

{% capture gift_wrap %}{{ subscription | custom_field: "Gift wrap?" }}
{% endcapture %}
{% if gift_wrap == "" %} ... {% endif %}
The "capture" action must coexist on the same line as the custom field you'd like to capture a value from in the email/logic.

Customer

Email Field Description
{{customer.id}} The unique customer id within Chargify
{{customer.first_name}} The customer’s first name
{{customer.last_name}} The customer’s last name
{{customer.email}} The email address of the customer
{{customer.organization}} The customer’s organization
{{customer.reference}} The unique identifier used within your own application for this customer
{{customer.created_at}} Timestamp for when the customer was created
{{customer.address}} The shipping address for the customer
{{customer.address_2}} Additional shipping information for the customer
{{customer.city}} The customer’s city information
{{customer.state}} The customer’s state information
{{customer.zip}} The zip code of the customer
{{customer.country}} The country of the customer
{{customer.phone}} The customer’s phone number
{{customer.billing_portal?}} True/false indicating whether or not this customer is managed in billing portal
{{customer.portal_invite_sent?}} True/false value indicating whether or not the customer was emailed an,invitation to manage their subscriptions in billing portal

Dunning Fields

Chargify has created a specific set of dunning-related email variables for usage only in dunning Emails. We house these specifically under the section titled Customizing your Dunning Emails. Please view additional variables for use in dunning at the link above.

Invoice Emails

Email Field Description
{{invoice.customer.name}} The name of the customer receiving the invoice
{{invoice.number}} The Chargify-issued invoice-number
{{invoice.issue_date}} The date the invoice was issued
{{invoice.total_amount}} The total amount of the invoice
{{invoice.due_amount}} The full amount due of the invoice
{{invoice.url}} The invoice to view the URL online
{{invoice.seller.name}} The seller who generated the invoice

Payment (only for receipt emails)

Email Field Description
{{payment.amount}} The amount just paid, formatted in your currency
{{payment.amount_in_cents}} The amount just paid, in cents
{{payment.card_expiration}} The expiration date of the card
{{payment.card_number}} The customer’s credit card, obscured to only show the last 4 digits. e.g. XXXX-XXXX-XXXX-1234
{{payment.card_type}} The type of card used (bogus, visa, master, discover, american_express, diners_club, jcb, switch, solo, dankort, maestro, forbrugsforeningen, laser)
{{payment.memo}} The memo associated with the transaction.
{{payment.success}} True/false value indicated whether or not the payment was a test.True/false value indicated whether or not the payment was successful.
{{payment.test}} True/false value indicated whether or not the payment was a test.
{{payment.gateway_transaction_id}} The transaction id from the gateway

Payment Profile

Email Field Description
{{payment_profile.id}} The unique payment profile id within Chargify
{{payment_profile.first_name}} The first name on the customer’s payment information
{{payment_profile.last_name}} The last name of the customer’s payment information
{{payment_profile.masked_card_number}} The customer’s credit card, obscured to only show the last 4 digits. e.g. XXXX-XXXX-XXXX-1234
{{payment_profile.card_type}} The type of card used (bogus, visa, master, discover, american_express,,diners_club, jcb, switch, solo, dankort, maestro, forbrugsforeningen, or laser)
{{payment_profile.brand}} The type of card used with it’s correct spelling (Bogus, Visa, Master, …)
{{payment_profile.billing_address}} The billing address for the payment profile
{{payment_profile.billing_address_2}} Additional billing information for the payment profile
{{payment_profile.billing_city}} The billing city for the payment information
{{payment_profile.billing_state}} The billing state for the payment information
{{payment_profile.billing_zip}} The zip code of the payment information
{{payment_profile.billing_country}} The country of the billing information
{{payment_profile_exists}} True or false indicating whether or not a valid payment method is on file for the subscription
{{payment_profile.expiration_month}} Expiration month of the credit card on file
{{payment_profile.expiration_year}} Expiration year of the credit card on file
{{payment_profile.payment_method_type}} Either card or bank account
Note: If you intend to use credit card-specific fields (like masked_card_number), be sure to wrap those sections of your email template in a {% if subscription.card_on_file? %}...{% endif %} block, to ensure you only use those fields when the payment profile is a credit card. You can use the same technique when calling bank account-specific fields by using the {% if subscription.bank_account_on_file? %}...{% endif %} block. .

Product

Email Field Description
{{product.id}} The unique product id within Chargify
{{product.name}} The product name
{{product.handle}} The product API handle
{{product.description}} The product description
{{product.accounting_code}} The product family accounting code (has no bearing in Chargify, may be used within your app)
{{product.price_in_cents}} The product price, in integer cents
{{product.initial_charge?}} True/false indicating whether or not the product has an initial charge
{{product.initial_charge_in_cents}} The up front charge you have specified
{{product.expires?}} True/false indicating whether or not the product expires
{{product.offers_trial?}} True/false indicating whether or not the product offers a trial price
{{product.trial_price_in_cents}} The product trial price, in integer cents
{{product.update_return_url}} The URL a buyer is returned to after successful account update. See the section on product Return URLs and Parameters
{{product.update_return_params}} The parameters string we will use in constructing your return URL. See the section on Product Return URLs and Parameters
{{product.request_credit_card?}} True/false indicating whether or not the product requests a credit card at signup
{{product.require_credit_card?}} True/false indicating whether or not the product requires a credit card at signup
{{product.archived?}} True/false indicating whether or not the product is currently archived
{{product.archived_at}} Timestamp for when the product was archived (if it was)
{{product.currency}} The product currency
{{product.price}} The product price, formatted in the product currency
{{product.initial_charge}} The initial charge, formatted in the product currency
{{product.trial_price}} The trial price, formatted in the product currency
{{product.recurring_duration}} The length of one renewal period (e.g. 30 days, 1 year, etc.)
{{product.expiration_duration}} The length of time before the product expires (if it does)
{{product.trial_duration}} The length of the product trial (if there is one)

Statements

You may use email templates in statements. However, please be aware that if you have enabled the billing portal, the liquid syntax you use in your statements will not display properly; liquid syntax will not render in the billing portal.

We consider the usage of liquid synax in statements edge-case-usage. You’re welcome to use them sparingly, but we must stress that the formatting of statements does not lend itself to this delivery method.

As an alternative, please use liquid syntax in emails to your subscribers as an alternative.

Subscription

Email Field Description
{{subscription.id}} The subscription unique id within Chargify.
{{subscription.state}} The current state of the subscription. Please see the documentation for subscription states
{{subscription.balance_in_cents}} Gives the current outstanding subscription balance in the number of cents
{{subscription.current_period_started_at}} Timestamp relating to the start of the current (recurring) period
{{subscription.current_period_starts_at}} Timestamp relating to the start of the current (recurring) period
{{subscription.current_period_ends_at}} Timestamp relating to the end of the current (recurring) period (i.e. when the next regularly scheduled attempted charge will occur)
{{subscription.trial_started_at}} Timestamp for when the trial period (if any) began
{{subscription.trial_ended_at}} Timestamp for when the trial period (if any) ended
{{subscription.trial_ends_at}} Timestamp for when the trial period (if any) ended
{{subscription.activated_at}} (Read Only) Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial)
{{subscription.expires_at}} Timestamp giving the expiration date of this subscription (if any)
{{subscription.cancellation_message}} Seller-provided reason for, or note about, the cancellation
{{subscription.canceled_at}} Timestamp for when the subscription canceled (if it did)
{{subscription.cancel_at_end_of_period}} Whether or not the subscription will (or has) canceled at the end of the period
{{subscription.payment_collection_method}} The type of payment collection to be used in the subscription. May be automatic, or invoice.
{{subscription.coupon_code}} The coupon code of the coupon currently applied to the subscription (if any)
{{subscription.total_revenue_in_cents}} Gives the total revenue from the subscription in the number of cents.
{{subscription.estimated_renewal_amount_in_cents}} Estimated amount of the next renewal, in cents
{{subscription.current_billing_amount_in_cents}} The balance_in_cents + the estimated_renewal_amount_in_cents
{{subscription.expires_at_end_of_period?}} True/false value indicating whether or not the subscription expires at the end of the current period
{{subscription.total_revenue}} Gives the total revenue from the subscription in the number of cents.
{{subscription.estimated_renewal_amount}} The estimated_renewal_amount_in_cents, formatted in the currency of the subscription
{{subscription.current_billing_amount}} The current_billing_amount_in_cents, formatted in the currency of the subscription
{{subscription.payment_method_on_file?}} True/false value indicating whether or not there is a payment_profile present
{{subscription.card_on_file?}} True/false value indicating whether or not the payment_profile is a credit card
{{subscription.bank_account_on_file?}} True/false value indicating whether or not the payment_profile is a bank account
{{subscription.billing_portal?}} True/false value indicating whether or not this customer is managed in blling portal
{{subscription.billing_portal_management_url}} The billing portal subscription management URL for this subscription, if billing portal is enabled
{{subscription.portal_invite_sent?}} True/false value indicating whether or not the customer was emailed an invitation to manage their subscriptions in billing portal
{{subscription.referral_code}} he referral code which can be appended to Public Signup Page URLs. See Referrals for more information.

Test Data

Custom fields are not available in the test data when editing an email template. Instead, you will see placeholder text in the email preview, for example:

[PLACEHOLDER: The value of "Color" on the Subscription will be included in the real email.]

If you misspell the name of the custom field, you will see a warning such as:

WARNING: The custom field "Gift warp?" does not exist for Subscriptions. This will always be blank in a real email.]

To see how your email will look with different values for the custom fields, we suggest creating subscriptions in a site that is in test mode, using your own email address so that you will receive the email.

For more information on test data, please see the following documentation on how to configure preview emails.


Backup Email Templates

Below is a collection of our standard email templates for all communications to subscribers. Please feel free to use these if you’d like to revert back to the original emails that ship with new sites.

Cancellation Emails

Hello {{name}},

We're sorry to see you go!

Per your request, your subscription to {{product_name}} was canceled on {{subscription.canceled_at | date:'%d %B %Y'}}.

If you did not request cancellation and this message is being received in error, please contact us to reactivate.

If you have any additional questions or need assistance, please let us know.

Thank you,

{{merchant_name}}

Card Expiration Emails

Dear {{name}},

Your credit card {{masked_card_number}} is set to expire in {{days_until_card_expiration}} day(s).

Please visit {{update_url}} to update your card.

Cheers,
{{merchant_name}}

End of Trial Emails

Dear {{name}},

Your trial period for {{product.name}} will end on {{subscription.current_period_ends_at | date:'%d %B %Y'}}
at around {{subscription.current_period_ends_at | date:'%H:%M %Z'}}.

{% if subscription.payment_method_on_file? %}Your {{payment_profile.payment_method_type}} {{payment_profile.payment_method_masked_number}} will be charged for the estimated amount due of {{subscription.current_billing_amount}}.
(The estimated amount does not include any add-on or overage charges that may be added between now and renewal.)

If you need to make a change to your billing information, please visit: {% if subscription.billing_portal? %}
{{subscription.billing_portal_management_url}}{% else %}
{{update_url}}{% endif %}

{% else %}In order to continue uninterrupted service, please add a card to your subscription: {% if subscription.billing_portal? %}
{{subscription.billing_portal_management_url}}{% else %}
{{update_url}}{% endif %}
{% endif %}
Thanks!
{{merchant_name}}

Invoice - Automatic

Dear {{invoice.customer.name}},

A new invoice for your {{invoice.seller.name}} account is now available.

**Invoice Number:** {{ invoice.number }}<br>
**Issue Date:** {{ invoice.issue_date }}<br>
**Total:** {{ invoice.total_amount | format_currency }}<br>
**Due:** {{ invoice.due_amount | format_currency }}<br>

View Invoice: <{{invoice.url}}>

Thank you,

{{invoice.seller.name}}

Invoice - Remittance / Manual

Dear {{invoice.customer.name}},

A new invoice for your {{invoice.seller.name}} account is now available. {{ invoice.due_amount | format_currency }} is now due.

{{invoice.url}}

Thank you,

{{invoice.seller.name}}

Receipt Email

Dear {{name}}

You were just charged {{payment.amount}} for {{product_name}}.

{% if balance_in_cents > 0 %}
The outstanding amount for your subscription is {{balance}}.
{% endif %}

Cheers,
{{merchant_name}}

Signup Email

Hello {{name}},

You've signed up for {{product_family}} ({{product_name}}).
{% if product.update_return_url %}
Now that you're all signed up, head over to {{product.update_return_url}}.
{% endif %}

Thanks,
{{merchant_name}}

Upcoming Renewal Emails

Dear {{name}},

{% if subscription.expires_at_end_of_period? %}Your subscription to {{product.name}} will expire on {{subscription.current_period_ends_at | date:'%d %B %Y'}}
at around {{subscription.current_period_ends_at | date:'%H:%M %Z'}}. You will not be billed again for this subscription.
{% else %}Your subscription to {{product.name}} will renew on {{subscription.current_period_ends_at | date:'%d %B %Y'}}
at around {{subscription.current_period_ends_at | date:'%H:%M %Z'}}.

{% if subscription.payment_method_on_file? %}Your {{payment_profile.payment_method_type}} {{payment_profile.payment_method_masked_number}} will be charged for the estimated amount due of {{subscription.current_billing_amount}}.
(The estimated amount does not include any add-on or overage charges that may be added between now and renewal.)

If you need to make a change to your billing information, please visit: {% if subscription.billing_portal? %}
{{subscription.billing_portal_management_url}}{% else %}
{{update_url}}{% endif %}

{% else %}In order to continue uninterrupted service, please add a card to your subscription: {% if subscription.billing_portal? %}
{{subscription.billing_portal_management_url}}{% else %}
{{update_url}}{% endif %}
{% endif %}{% endif %}
Thanks!
{{merchant_name}}

Update Payment Request Emails

Dear {{name}},

{% if subscription.payment_method_on_file? %}

You may wish to update the {% if subscription.card_on_file? %}credit card{% elsif subscription.bank_account_on_file? %}bank account{% else %}paypal account{% endif %} on file for your account with us, either to make a payment or to replace the {% if subscription.card_on_file? %}credit card{% elsif subscription.bank_account_on_file? %}bank account{% else %}paypal account{% endif %} to which future payments will be processed. Kindly click on the following secure link to edit the details:

{{update_url}}

{% else %}

You currently do not have valid payment information on file with us. Kindly click on the following secure link to update your payment information:

{{update_url}}

{% endif %}

Thank you for your business.

{{merchant_name}}