You can configure dynamic content of your emails sent out to your subscribers via the Email Configuration page under Settings

This article shows a list of example template tags you can use to load dynamic relevant content into your email body. Read this article to learn more on editing and testing the email templates.

Dynamic Tags

Tags are formatted with curly braces {{ }}. By using the correct variable name (ie. {{plan.name}} ) together with the curly braces you can show relevant dynamic content to your customer.
Depending on the email template, there are a couple of categories of dynamic content available:

  • Plan: Current customer plan information, info like name, and monthly_price
  • Project: Your company and product names
  • Subscription: Subscriber details like full_name and full_address
  • Extra fields: Optional extra fields added to your project like date of birth

The category tags then look like:

{{plan.name}},
{{subscription.full_name}}

{{extra_fields.birthday}}

Available tags depend on the type of email that is being sent and are available under the plus sign in the email configuration edit box. See the full glossary of possible email tags.

Some template tags require a bit of HTML, so that your emails looks just as beautiful as the product your customer has subscribed to!

Example: Cancellation URL

To configure a link like the URL to cancel a subscription, you can add some HTML to make a link more "human readable":

<a href={{subscription.cancellation_url}}>Cancel my subscription</a>


The {{subscription.cancellation_url}} is the dynamic tag used and >Cancel my subscription< is example copy you can use that will be displayed to your customer.

Example: Outstanding Invoices overview

We provide the option to display all outstanding invoices to your customer and using the outstanding_invoices variable this is possible.

To display all the invoices and create a separate line with the invoice data, we use the {%  %} braces (instead of just {{ .. }} for displaying data). The following example code is the structure to fill in:

{% for invoice in outstanding_invoices %}
...we do stuff here like display a {{invoice.amount}}
{% endfor %}


You can use the following example to display the outstanding invoices and show their amount, current status, and a link to a page where a customer can pay their invoice directly.

<table width="100%">
{% for invoice in outstanding_invoices %}
  <tr>
    <td>{{invoice.number}}</td>
    <td>{{invoice.amount}}</td>
    <td>{{invoice.status}}</td>
    <td><a href="{{invoice.pay_now_url}}">Show invoice</a></td>
  </tr>
{% endfor %}
</table>

Example: Show text only after subscription is 90 days old

Sometimes you only want a piece of information to be available when a subscription is running for some time. This can be a display of the extra services you provide or a reason to motivate your subscribers to re-order.

In this example we first need to calculate if the subscription is at least 90 days old. After that, only show the information for these subscribers.

{% assign contract_start = subscription.subscription_started_at | date: '%s'  %}
{% assign three_months_ago = 'now' | date: '%s' | minus : 7776000 | date: '%s' %}

contract_start: {{contract_start}}
90days ago: {{three_months_ago}}

{% if three_months_ago > contract_start %}
YES! You are eligible for our service upgrade
{% else %}
Not yet a subscriber for three months
{% endif %}

The {% assign command creates a temporarily variable and the pipe |  puts this value through a "filter". So the first row does a couple of things:

  • Set the value of contract_start to the start date of the subscription, than format it to a date in seconds since 1970 (the %s ). 
  • Set the value of three_months_ago  to the date/time of now. format it to a date in seconds from 1970, substract 7.7 million seconds (60*60*24*90) and format it "again" to a date in seconds. This last date  command makes the field type a "date" again, so it's comparable to the contract_start , otherwise it was a string and incomparable
  • The {% if three_months_ago > contract_start %}  compares if the two values and  shows the "yes" if the subscription is older than 90 days or "no" if younger.
Did this answer your question?