less than a minute read • Updated an hour ago
Customise subscription email templates
How to customize the emails Foxy sends for subscription renewals, failed payments, expiring cards, and cancellations using Twig variables.
Foxy uses your store’s standard email receipt template for all subscription-related emails. You can customise the content of these emails using Twig variables to display messaging specific to each email type.
Available Twig variables
Variable | Email type | Description |
|---|---|---|
| Failed payment reminder | True when the email is a failed payment reminder |
| Cancellation after failed payment | True when the email is a cancellation notice due to failed payment |
| Expiring card reminder | True when the email is an expiring card reminder |
| Failed payment reminder | Number of days since the subscription first failed to process |
Example: escalating urgency based on days past due
Use days_since_first_failed_transaction to vary the tone of your failed payment reminder emails based on how long the payment has been outstanding:
{% set sub = subscriptions|first %}
{% if sub %}
{% if days_since_first_failed_transaction < 15 %}
This email is a reminder that your subscription is currently {{ days_since_first_failed_transaction }} days past due. To bring your subscription up to date, use the link below:
{{ sub_token_url }}&empty=true&cart=checkout
{% elseif days_since_first_failed_transaction > 15 and days_since_first_failed_transaction < 28 %}
This email is a reminder that your subscription is currently {{ days_since_first_failed_transaction }} days past due. Your subscription will be cancelled automatically in {{ 30 - days_since_first_failed_transaction }} days.
To bring your subscription up to date, use the link below:
{{ sub_token_url }}&empty=true&cart=checkout
{% elseif days_since_first_failed_transaction == 29 %}
Your subscription is currently {{ days_since_first_failed_transaction }} days past due. Your subscription will be cancelled TOMORROW unless you update your payment information using the link below:
{{ sub_token_url }}&empty=true&cart=checkout
{% endif %}
{% endif %}
Expiring card reminder language strings
The following language strings are available for the expiring card reminder email and can be customised in your store’s language settings:
Language string | Description |
|---|---|
| Email subject line |
| Plain text email body |
| HTML email body |
Notes
All subscription emails use the same base email receipt template as regular transaction emails. Subscription-specific content is conditionally shown using the Twig variables above.
To find the default template structure, search for
is_subscription_dunning_reminder,is_subscription_dunning_cancellation, oris_expiring_payment_reminderin your store’s default email template.See Set up failed payment reminder emails and Set up expiring card reminder emails for details on configuring when these emails are sent.