Merge Tags

All emails sent from ChargeOver are customizable, and can contain "merge tags" which are replaced by values from data with ChargeOver before the email is sent.

Tags can also be used to build basic IF/THEN statements and loops into your ChargeOver emails.

Tags

ChargeOver merge tags are documented below.

Customers

Customers

Merge Tag Type Description  
{{customer.customer_id}} integer Customer ID # 📎
{{customer.parent_customer_id}} integer Parent customer ID # 📎
{{customer.token}} string Customer Token 📎
{{customer.superuser_id}} integer Main contact ID # 📎
{{customer.external_key}} string External key value 📎
{{customer.display_as}} string Deprecated 📎
{{customer.company}} string Company/customer name 📎
{{customer.language_id}} integer Language ID # 📎
{{customer.currency_id}} integer Currency ID # 📎
{{customer.currency_iso4217}} string ISO 4217 currency code representation 📎
{{customer.currency_symbol}} string Symbol for currency ($, £, etc.) 📎
{{customer.class_id}} integer Default class tracking ID # 📎
{{customer.admin_id}} integer Admin/Worker ID # 📎
{{customer.campaign_id}} integer Campaign/lead source ID # 📎
{{customer.custtype_id}} integer Customer type ID # 📎
{{customer.no_taxes}} boolean Flag to disable charging of taxes 📎
{{customer.no_dunning}} boolean Flag to disable dunning 📎
{{customer.superuser_username}} string Main contact username 📎
{{customer.superuser_email}} string Main contact e-mail address 📎
{{customer.superuser_name}} string Main contact name 📎
{{customer.superuser_first_name}} string Main contact first name 📎
{{customer.superuser_last_name}} string Main contact last name 📎
{{customer.superuser_phone}} string Main contact phone number 📎
{{customer.superuser_token}} string Main contact token 📎
{{customer.bill_addr1}} string Billing address line 1 📎
{{customer.bill_addr2}} string Billing address line 2 📎
{{customer.bill_addr3}} string Billing address line 3 📎
{{customer.bill_city}} string Billing address city 📎
{{customer.bill_state}} string Billing address state/province 📎
{{customer.bill_postcode}} string Billing address postal code 📎
{{customer.bill_country}} string Billing address country 📎
{{customer.bill_block}} string Printable billing address 📎
{{customer.ship_addr1}} string Shipping address line 1 📎
{{customer.ship_addr2}} string Shipping address line 2 📎
{{customer.ship_addr3}} string Shipping address line 3 📎
{{customer.ship_city}} string Shipping address city 📎
{{customer.ship_state}} string Shipping address state 📎
{{customer.ship_postcode}} string Shipping address postal code 📎
{{customer.ship_country}} string Shipping address country 📎
{{customer.ship_block}} string Printable shipping address 📎
{{customer.custom_1}} string Custom field #1 📎
{{customer.custom_2}} string Custom field #2 📎
{{customer.custom_3}} string Custom field #3 📎
{{customer.custom_4}} string Custom field #4 📎
{{customer.custom_5}} string Custom field #5 📎
{{customer.custom_6}} string Custom field #6 📎
{{customer.total}} float The sum total amount of all invoices ever issued to this customer 📎
{{customer.balance}} float Balance due for this customer 📎
{{customer.paid}} float The sum total amount of all payments ever made by this customer 📎
{{customer.write_datetime}} string Date/time this customer was created 📎
{{customer.write_ipaddr}} string IP address that created this customer 📎
{{customer.mod_datetime}} string Date/time this customer was updated 📎
{{customer.mod_ipaddr}} string IP address that last updated this customer 📎
{{customer.brand_id}} integer Brand ID # 📎
{{customer.class_name}} string Class name 📎
{{customer.custtype_name}} string Customer type name 📎
{{customer.terms_id}} integer Default terms ID # 📎
{{customer.terms_name}} string Default payment terms 📎
{{customer.terms_days}} integer # of days for the default payment terms 📎
{{customer.url_statementlink}} string URL the customer can visit to view thier monthly statement 📎
{{customer.url_paymethodlink}} string URL the customer can visit to update their payment method 📎
{{customer.url_self}} string URL for viewing the customer in the GUI 📎
{{customer.admin_name}} string Admin/Worker Name 📎
{{customer.admin_email}} string Admin/Worker Email 📎
{{customer.customer_status_id}} string 📎
{{customer.customer_status_name}} string Human-friendly customer status 📎
{{customer.customer_status_str}} string Status string 📎
{{customer.customer_status_state}} string Status code 📎
{{customer.default_paymethod}} string Default payment method type 📎
{{customer.default_creditcard_id}} integer Default credit card ID # (if the default payment method is a credit card) 📎
{{customer.default_ach_id}} integer Default ACH/eCheck ID # (if the default payment method is ACH) 📎
{{customer.invoice_delivery}} enum Delivery method for initial invoices ("email" or "print" for printed hard-copy) 📎
{{customer.dunning_delivery}} enum Delivery method for dunning/reminder invoices ("email" or "print" for printed hard-copy via Docsaway, Lob, etc.) 📎
{{customer.tax_ident}} string Tax ID #/VAT # 📎

Users / Contacts

Users / Contacts

Merge Tag Type Description  
{{user.user_id}} integer The user/contact ID # 📎
{{user.external_key}} string External key value 📎
{{user.token}} string Unique token 📎
{{user.username}} string Customer portal username 📎
{{user.name}} string First and last name of the contact 📎
{{user.first_name}} string First name of contact 📎
{{user.middle_name_glob}} string Middle name/initial 📎
{{user.last_name}} string Last name 📎
{{user.name_suffix}} string Suffix (e.g. "Jr.", "Sr.", "III", etc.) 📎
{{user.display_as}} string (deprecated) 📎
{{user.title}} string Title 📎
{{user.email}} string E-mail address 📎
{{user.phone}} string Phone number 📎
{{user.user_type_id}} integer User type ID # 📎
{{user.user_type_name}} string User type 📎
{{user.customer_id}} integer The customer ID # this contact belongs to 📎
{{user.custom_1}} string Custom field #1 📎
{{user.custom_2}} string Custom field #2 📎
{{user.custom_3}} string Custom field #3 📎
{{user.custom_4}} string Custom field #3 📎
{{user.custom_5}} string Custom field #3 📎
{{user.write_datetime}} datetime Date/time the user/contact was created 📎
{{user.mod_datetime}} datetime Date/time the user/contact was last modified 📎
{{user.url_self}} string URL for viewing the user/contact in the GUI 📎

Invoices

Invoices

Merge Tag Type Description  
{{invoice.invoice_id}} integer Invoice ID # 📎
{{invoice.refnumber}} string Invoice reference number 📎
{{invoice.external_key}} string External key value 📎
{{invoice.package_id}} integer Subscription ID # this invoice was generated from 📎
{{invoice.customer_id}} integer Customer ID # 📎
{{invoice.brand_id}} integer Brand ID # 📎
{{invoice.write_datetime}} datetime Date/time the invoice was created 📎
{{invoice.void_datetime}} datetime Date/time the invoice was voided 📎
{{invoice.date}} date Invoice date 📎
{{invoice.currency_id}} integer Currency ID # 📎
{{invoice.currency_symbol}} string Currency symbol 📎
{{invoice.currency_iso4217}} string Currency ISO 4217 representation 📎
{{invoice.terms_id}} integer Terms ID # 📎
{{invoice.terms_name}} string Terms name 📎
{{invoice.terms_days}} integer Terms # of days 📎
{{invoice.admin_id}} integer Admin/Worker ID # 📎
{{invoice.admin_name}} string Admin/Worker Name 📎
{{invoice.token}} string Unique token 📎
{{invoice.bill_addr1}} string Billing address line 1 📎
{{invoice.bill_addr2}} string Billing address line 2 📎
{{invoice.bill_addr3}} string Billing address line 3 📎
{{invoice.bill_city}} string Billing address city 📎
{{invoice.bill_state}} string Billing address state 📎
{{invoice.bill_postcode}} string Billing address postal code 📎
{{invoice.bill_country}} string Billing address country 📎
{{invoice.bill_notes}} string 📎
{{invoice.bill_block}} string Printable billing address 📎
{{invoice.ship_addr1}} string 📎
{{invoice.ship_addr2}} string 📎
{{invoice.ship_addr3}} string 📎
{{invoice.ship_city}} string 📎
{{invoice.ship_state}} string 📎
{{invoice.ship_postcode}} string 📎
{{invoice.ship_country}} string 📎
{{invoice.ship_notes}} string 📎
{{invoice.ship_block}} string 📎
{{invoice.cycle_pre_from_date}} date For pre-billing, cycle start date 📎
{{invoice.cycle_pre_to_date}} date For pre-billing, cycle end date 📎
{{invoice.cycle_this_date}} date Cycle date (generally the invoice date) 📎
{{invoice.cycle_post_from_date}} date For post-billing (in arrears), cycle start date 📎
{{invoice.cycle_post_to_date}} date For post-billing (in arrears), cycle end date 📎
{{invoice.url_permalink}} string URL to view the invoice 📎
{{invoice.url_pdflink}} string URL to download the invoice PDF 📎
{{invoice.url_paylink}} string URL to pay for the invoice 📎
{{invoice.url_self}} string URL for viewing the invoice in the GUI 📎
{{invoice.is_paid}} boolean Whether or not the invoice has been paid 📎
{{invoice.is_void}} boolean Whether or not the invoice has been voided 📎
{{invoice.is_overdue}} boolean Whether or not the invoice is overdue 📎
{{invoice.due_date}} date Date the invoice is due 📎
{{invoice.days_overdue}} integer # of days overdue the invoice is 📎
{{invoice.paid_date}} date Date this invoice was paid 📎
{{invoice.balance}} float Balance of the invoice 📎
{{invoice.applied}} float Amount applied to the invoice 📎
{{invoice.total}} float Invoice total 📎
{{invoice.subtotal}} float Invoice subtotal 📎
{{invoice.taxes}} float Taxes 📎
{{invoice.credits}} float Amount of credits applied to the invoice 📎
{{invoice.payments}} float Amount of payments applied to the invoice 📎
{{invoice.writeoffs}} float Amount written off 📎
{{invoice.declines}} integer # of times that payment was attempted and failed for this invoice 📎
{{invoice.sum_base}} float 📎
{{invoice.sum_usage}} float 📎
{{invoice.sum_onetime}} float 📎
{{invoice.invoice_status_name}} string Human-friendly invoice status 📎
{{invoice.invoice_status_str}} string Status string 📎
{{invoice.invoice_status_state}} string Status code 📎
{{invoice.memo}} string Memo/notes to customer 📎
{{invoice.custom_1}} string Custom field #1 📎
{{invoice.custom_2}} string Custom field #2 📎
{{invoice.custom_3}} string Custom field #3 📎
{{invoice.custom_4}} string Custom field #4 📎
{{invoice.custom_5}} string Custom field #5 📎
{{invoice.line_items}} array A list of line items for the invoice 📎

Quotes

Quotes

Merge Tag Type Description  
{{quote.quote_id}} integer Quote ID # 📎
{{quote.refnumber}} string Quote reference number 📎
{{quote.external_key}} string External key value 📎
{{quote.customer_id}} integer Customer ID # 📎
{{quote.write_datetime}} datetime Date/time the quote was created 📎
{{quote.date}} date Quote date 📎
{{quote.currency_id}} integer Currency ID # 📎
{{quote.currency_symbol}} string Currency symbol 📎
{{quote.currency_iso4217}} string Currency ISO 4217 representation 📎
{{quote.terms_id}} integer Terms ID # 📎
{{quote.terms_name}} string Terms name 📎
{{quote.terms_days}} integer Terms # of days 📎
{{quote.admin_id}} integer Admin/Worker ID # 📎
{{quote.admin_name}} string Admin/Worker Name 📎
{{quote.token}} string Unique token 📎
{{quote.bill_addr1}} string Billing address line 1 📎
{{quote.bill_addr2}} string Billing address line 2 📎
{{quote.bill_addr3}} string Billing address line 3 📎
{{quote.bill_city}} string Billing address city 📎
{{quote.bill_state}} string Billing address state 📎
{{quote.bill_postcode}} string Billing address postal code 📎
{{quote.bill_country}} string Billing address country 📎
{{quote.bill_notes}} string 📎
{{quote.bill_block}} string Printable billing address 📎
{{quote.ship_addr1}} string 📎
{{quote.ship_addr2}} string 📎
{{quote.ship_addr3}} string 📎
{{quote.ship_city}} string 📎
{{quote.ship_state}} string 📎
{{quote.ship_postcode}} string 📎
{{quote.ship_country}} string 📎
{{quote.ship_notes}} string 📎
{{quote.ship_block}} string 📎
{{quote.url_permalink}} string URL to view the quote 📎
{{quote.url_pdflink}} string URL to get a PDF of the quote 📎
{{quote.url_self}} string URL for viewing the quote in the GUI 📎
{{quote.due_date}} date Date the quote is due 📎
{{quote.total}} float Quote total 📎
{{quote.subtotal}} float Quote subtotal 📎
{{quote.taxes}} float Taxes 📎
{{quote.quote_status_name}} string 📎
{{quote.quote_status_str}} string 📎
{{quote.quote_status_state}} string 📎
{{quote.memo}} string Memo/notes to customer 📎
{{quote.custom_1}} string Custom field #1 📎
{{quote.custom_2}} string Custom field #2 📎
{{quote.custom_3}} string Custom field #3 📎
{{quote.custom_4}} string Custom field #4 📎
{{quote.custom_5}} string Custom field #5 📎
{{quote.line_items}} array A list of line items for the quote 📎

Quote Line Items

Quote Line Items

Merge Tag Type Description  
{{quoteline.line_item_id}} integer Invoice line ID # 📎
{{quoteline.quote_id}} integer Invoice ID # 📎
{{quoteline.item_id}} integer Item ID # for this line 📎
{{quoteline.item_name}} string Item name 📎
{{quoteline.item_accounting_sku}} string Item accounting SKU 📎
{{quoteline.item_external_key}} string Item external key 📎
{{quoteline.item_token}} string Item token 📎
{{quoteline.tierset_id}} integer Tierset ID # for this line 📎
{{quoteline.descrip}} string Description 📎
{{quoteline.line_rate}} float Rate 📎
{{quoteline.line_quantity}} float Quantity 📎
{{quoteline.line_subtotal}} float Line subtotal 📎
{{quoteline.line_total}} float Line total 📎
{{quoteline.tax_taxable}} float The total amount that was taxable 📎
{{quoteline.tax_taxed}} float The amount that tax was calculated from 📎
{{quoteline.tax_total}} float The tax amount for this line 📎
{{quoteline.tax_id}} string 📎
{{quoteline.tax_group_id}} string 📎
{{quoteline.is_setup}} bool 📎
{{quoteline.is_base}} bool 📎
{{quoteline.is_taxed}} bool 📎
{{quoteline.custom_1}} string Custom field 1 📎
{{quoteline.custom_2}} string Custom field 2 📎
{{quoteline.custom_3}} string Custom field 3 📎

Subscriptions (Packages)

Subscriptions (Packages)

Merge Tag Type Description  
{{package.package_id}} integer Package ID # 📎
{{package.customer_id}} integer Customer ID # 📎
{{package.brand_id}} integer Brand ID # 📎
{{package.class_id}} integer Class ID # 📎
{{package.class_name}} string Class name 📎
{{package.external_key}} string External key value 📎
{{package.token}} string Unique token 📎
{{package.nickname}} string Nickname for the package 📎
{{package.paymethod}} string Payment method for the package, one of: cre, inv, ach 📎
{{package.creditcard_id}} integer Credit card ID # (if the package is paid by credit card) 📎
{{package.ach_id}} integer ACH ID # (if the package is paid by ACH) 📎
{{package.tokenized_id}} integer Tokenized ID # (if the package is paid by an external service token) 📎
{{package.admin_id}} integer Admin/worker ID # 📎
{{package.admin_name}} string Admin/worker name 📎
{{package.bill_addr1}} string Billing address line 1 📎
{{package.bill_addr2}} string Billing address line 2 📎
{{package.bill_addr3}} string Billing address line 3 📎
{{package.bill_city}} string Billing address city 📎
{{package.bill_state}} string Billing address state 📎
{{package.bill_postcode}} string Billing address postal code 📎
{{package.bill_country}} string Billing address country 📎
{{package.bill_notes}} string 📎
{{package.ship_addr1}} string 📎
{{package.ship_addr2}} string 📎
{{package.ship_addr3}} string 📎
{{package.ship_city}} string 📎
{{package.ship_state}} string 📎
{{package.ship_postcode}} string 📎
{{package.ship_country}} string 📎
{{package.ship_notes}} string 📎
{{package.currency_id}} integer Currency ID # 📎
{{package.currency_iso4217}} string Currency ISO 4217 code 📎
{{package.currency_symbol}} string Currency symbol 📎
{{package.amount_collected}} float Total amount collected so far for this package 📎
{{package.amount_invoiced}} float Total amount invoiced so far 📎
{{package.amount_due}} float Total amount due (invoiced - collected) 📎
{{package.suspendfrom_datetime}} datetime Date/time this package was suspended from 📎
{{package.suspendto_datetime}} datetime Date/time this package was suspended to 📎
{{package.next_invoice_datetime}} datetime The date the next invoice will be generated 📎
{{package.is_overdue}} boolean Whether or not the invoice is overdue 📎
{{package.days_overdue}} integer # of days overdue the package is 📎
{{package.start_datetime}} datetime Date/time this package was started/effective 📎
{{package.cancel_datetime}} datetime Date/time this package was cancelled 📎
{{package.write_datetime}} datetime Date/time this package was created 📎
{{package.mod_datetime}} datetime Date/time this package was last updated 📎
{{package.holduntil_datetime}} datetime Date/time invoicing for this package is being held until 📎
{{package.package_status_id}} string 📎
{{package.package_status_name}} string User-friendly subscription status 📎
{{package.package_status_str}} string 📎
{{package.package_status_state}} string 📎
{{package.cancel_reason}} string Reason for cancellation 📎
{{package.terms_id}} integer Terms ID # 📎
{{package.terms_name}} string Payment terms 📎
{{package.terms_days}} integer Terms # of days 📎
{{package.paycycle}} string Payment cycle 📎
{{package.custom_1}} string Custom field value #1 📎
{{package.custom_2}} string Custom field value #2 📎
{{package.custom_3}} string Custom field value #3 📎
{{package.custom_4}} string Custom field value #4 📎
{{package.custom_5}} string Custom field value #5 📎
{{package.line_items}} array 📎
{{package.url_self}} string URL for viewing the subscription in the GUI 📎

Transactions

Transactions

Merge Tag Type Description  
{{transaction.transaction_id}} integer Transaction ID # 📎
{{transaction.customer_id}} integer Customer ID # 📎
{{transaction.brand_id}} integer Brand ID # 📎
{{transaction.gateway_id}} integer Payment gateway ID # 📎
{{transaction.gateway_status}} integer Payment gateway status (1 for success, 0 for failure) 📎
{{transaction.gateway_transid}} string Payment gateway transaction identifier 📎
{{transaction.gateway_method}} string Payment gateway method 📎
{{transaction.gateway_msg}} string An error message or note from the payment gateway 📎
{{transaction.gateway_err_code}} integer 📎
{{transaction.gateway_err_detail}} string 📎
{{transaction.token}} string A unique token for the transaction 📎
{{transaction.external_key}} string Transaction external key value 📎
{{transaction.currency_id}} integer Currency ID # 📎
{{transaction.currency_iso4217}} string Currency ISO 4217 code 📎
{{transaction.currency_symbol}} string Currency symbol 📎
{{transaction.amount}} float Total transaction amount (refunds will be negative) 📎
{{transaction.fee}} float Transaction fee (if gateway provides this data) 📎
{{transaction.applied}} float Amount that is applied to invoices 📎
{{transaction.unapplied}} float Amount that is unapplied (not applied to any invoices) 📎
{{transaction.transaction_date}} date Date of the transaction 📎
{{transaction.transaction_status_name}} string Human-friendly transaction status 📎
{{transaction.transaction_status_str}} string Status string 📎
{{transaction.transaction_status_state}} string State code 📎
{{transaction.transaction_type}} string Transaction type (one of: pay, ref, cre, spl) 📎
{{transaction.transaction_type_name}} string Transaction type name 📎
{{transaction.transaction_method}} string Transaction method 📎
{{transaction.transaction_detail}} string Transaction details 📎
{{transaction.transaction_datetime}} datetime Date/time of the transaction was created 📎
{{transaction.transaction_ipaddr}} string IP address that created the transaction 📎
{{transaction.void_datetime}} datetime Date/time the transaction was voided 📎
{{transaction.url_self}} string URL for viewing the transaction in the GUI 📎

Credit Cards

Credit Cards

Merge Tag Type Description  
{{creditcard.customer_id}} integer The customer id # 📎
{{creditcard.creditcard_id}} integer The credit card ID # 📎
{{creditcard.external_key}} string Unique external key value 📎
{{creditcard.type}} string Credit card type 📎
{{creditcard.type_name}} string Credit card type user-friendly name 📎
{{creditcard.token}} string Credit card token 📎
{{creditcard.name}} string Name on credit card 📎
{{creditcard.mask_number}} string Credit card number (masked for security) 📎
{{creditcard.mask_and_bin_number}} string Credit card number with BIN (masked for security) 📎
{{creditcard.expdate}} string Expiration date (in YYYY-MM-DD format) 📎
{{creditcard.expdate_year}} string Expiration year (4-digits, YYYY) (only required if you do not provide expdate) 📎
{{creditcard.expdate_month}} string Expiration month (2-digits, MM) (only required if you do not provide expdate) 📎
{{creditcard.expdate_formatted}} string Expiration date (formatted) 📎
{{creditcard.address}} string Billing street address 📎
{{creditcard.city}} string Billing city 📎
{{creditcard.postcode}} string Billing postal code 📎
{{creditcard.country}} string Billing country 📎
{{creditcard.url_updatelink}} string 📎
{{creditcard.write_datetime}} datetime Date/time the credit card was stored 📎
{{creditcard.write_ipaddr}} datetime IP address that created the card 📎

ACH/eCheck Accounts

ACH/eCheck Accounts

Merge Tag Type Description  
{{ach.ach_id}} integer ACH ID # 📎
{{ach.customer_id}} integer Customer ID # 📎
{{ach.external_key}} string Unique external key value 📎
{{ach.type}} string Bank account type (one of: chec, busi, savi) 📎
{{ach.type_name}} string Bank account type (pretty name) 📎
{{ach.token}} string ACH account token 📎
{{ach.mask_number}} string Bank account number 📎
{{ach.mask_routing}} string Bank account routing number 📎
{{ach.name}} string Name on bank account 📎
{{ach.mask_bank}} string Bank name 📎

Formatting

There are many formatting options available to you to format data.

abs

The abs filter returns the absolute value.

{# number = -5 #}
{{ number|abs }}

{# outputs 5 #}

date

The date filter formats a date.

{# the_date = "2016-11-28" #}
{{ the_date|date("m/d/Y") }}

{# outputs 11/28/2018 #}

You can use any of the following formatters:

  • d – Day of the month, 2 digits with leading zeros, 01 to 31
  • D – A textual representation of a day, three letters, Mon through Sun
  • j – Day of the month without leading, zeros 1 to 31
  • l – (lowercase ‘L’) A full textual representation of the day of the week, Sunday through Saturday
  • S – English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j.
  • F – A full textual representation of a month, such as January or March, January through December
  • m – Numeric representation of a month, with leading zeros, 01 through 12
  • M – A short textual representation of a month, three letters, Jan through Dec
  • n – Numeric representation of a month, without leading zeros, 1 through 12
  • t – Number of days in the given month, 28 through 31
  • Y – A full numeric representation of a year, 4 digits. Examples: 1999 or 2003
  • y – A two digit representation of a year. Examples: 99 or 03
  • a – Lowercase Ante meridiem and Post meridiem, am or pm
  • A – Uppercase Ante meridiem and Post meridiem, AM or PM
  • g – 12-hour format of an hour without leading zeros, 1 through 12
  • G – 24-hour format of an hour without leading zeros, 0 through 23
  • h – 12-hour format of an hour with leading zeros, 01 through 12
  • H – 24-hour format of an hour with leading zeros, 00 through 23
  • O – Difference to Greenwich time (GMT) in hours. Example: +0200
  • P – Difference to Greenwich time (GMT) with colon between hours and minutes. Example: +02:00
  • T – Timezone abbreviation. Examples: EST, MDT ...
  • c – ISO 8601 date. Example: 2004-02-12T15:19:21+00:00
  • r – RFC 2822 formatted date. Example: Thu, 21 Dec 2000 16:01:07 +0200

date_modify

The date_modify filter allows you to modify a date by adding or subtracting days, months etc.

For example, if you wanted to generate an invoice ahead of time for a customer in May 2017, but the period of service it covers is June, you could put in the item description:

Service for {{invoice.date|date_modify("+1 month")|date("F Y") }}

This will print "Service for June 2017"

default

The default filter will set a default value for a value that is undefined or empty.



{{ var|default('var is not defined') }}

{{ var.foo|default('foo item on var is not defined') }}

{{var['foo']|default('foo item on var is not defined') }}

{{ ''|default('passed var is empty') }}


lower

The lower filter converts a value to lowercase.

For example:
{{ 'CHARGEOVER'|lower }}

Will print "chargeover"

number_format

The number_format filter formats numbers.

You can control the number of decimal places, decimal point, and thousands separator using the additional arguments.

If no formatting options are provided then the default formatting options are:

  • 0 decimal places.
  • . as the decimal point.
  • , as the thousands separator.
{{ 2345.353|number_format }}
// Will print 2,345

{{ 2345.353|number_format(2) }}
// Will print 2,345.35

replace

The replace filter will format a given string by replacing placeholders.

For example, if you had a string like the one below, and the customer.company name you were referencing was 'John Doe':


{{"I like %this%."|replace({'%this%': customer.company})}}

will print "I like John Doe."

A common use example of the replace filter is:


|replace("American Express", "AMEX")

will print "AMEX" in place of American Express.

round

The round filter rounds a number to a specified precision.

For example:


{{ 10.5678|round }}
 will print 11

{{ 10.5678|round(1) }}
 will print 10.6 

{{ 10.5678|round(2) }}
 will print 10.57

{{ 10.5678|round(3) }}
 will print 10.568

1. common rounds either up or down (rounds the value up when it is halfway or more to the next whole number, rounds the value down when it is less than half way)

2. ceil always rounds up

3. floor always rounds down


1. {{ 10.56|round }}
    will print 11

  {{ 10.44|round }}
   will print 10

2.{{ 10.44|round(1,'ceil') }}
   will print 10.5

3.{{ 10.789|round(1,'floor') }}
   will print 10.7

upper

The upper filter converts a value to uppercase.

For example:
{{ 'chargeover'|upper }}

Will print "CHARGEOVER"

Template Logic

ChargeOver supports a simple template syntax to allow you to build IF/ELSE statements (and more) into your emails.

Feel free to reach out to our support team for more assistance with templating.

IF/ELSE blocks

You can use IF/ELSE statements to implement logic within your templates.

A common example is customizing language depending on how overdue an invoice is.

{% if invoice.days_overdue > 90 %}
  Your invoice is really, REALLY overdue!
{% else %}
  Your invoice is overdue.
{% endif %}

FOR loops

You can use loops to iterate through collections of objects.

A common example is looping through the list of line items on an invoice.

{% for line in invoice.line_items %}
	Product: {{ line.item_name }}
	Rate: {{invoice.currency_symbol}}{{ line.line_rate }}
	Quantity: {{ line.line_quantity }}
{% endfor %}

Logic / Math

Expressions can be used to do math and logic directly within templates.

Math

+ Adds two objects together (the operands are casted to numbers). {{ 1 + 1 }} is 2
- Subtracts the second number from the first one. {{ 3 - 2 }} is 1
/ Divides two numbers. The returned value will be a floating point number. {{ 1 / 2 }} is 0.5
* Multiplies the left operand with the right one. {{ 2 * 2 }} would return 4

Logic

and Returns true if the left and the right operands are both true.
or Returns true if the left or the right operand is true.
not Negates a statement.
(expr) Groups an expression.

 

0.075 (gen) on Sat, 21 Apr 2018 10:05:39 -0500