Is anyone else experiencing issues with email template form variables?
I’ve tried the following with the syntax from the documentation:
Subject:
Invoice {InvoiceNumber} from Foo Bar
Body:
Invoice {InvoiceNumber} for the amount of {TotalAmount} is now available.
You have {TotalAmount} outstanding to be paid by {DueDate}.
Feel free to contact me if you have any questions.
Below is the output when I test email an invoice to myself. Worth noting too, I don’t have any issues with the @@variables@@ for HTML sales invoice footer forms.
That’s something! I can get the customer name with {{ recipient.name }}.. I’ve tried guessing others e.g. {{ invoice.number }}, {{ total.amount }}, {{ due.date }}, and they convert to blanks.. so it seems like there’s a partially implemented schema. Given PDF generation works, it wouldn’t be too difficult to get the merge fields working?
If the software were open source and the documentation were a wiki, users like me would gladly spend a bit of time to help in return for the free software @lubos
Thank you @Frankie . I’ve been trying to guess the total amount field e.g. {{ total_amount }}.. however I’ve found your’s shown are the only three available if I loop through the available fields
{% for field in fields %}
{{ field.label }}: {{ field.text }}
{% endfor %}
will output, in my example
Invoice date: 19/01/2026
Due date: 18/02/2026
Invoice number: 19
Got no idea if this will still work as the version of manager I’m using is old, but it may help
{% for total in table.totals %}{% if total.label == 'Total' %}{% capture invoice_total %}{{ total.text }}{% endcapture %}{% endif %}{% endfor %}
{% for field in fields %}{% if field.label == 'Invoice date' %}{% capture invoice_date %}{{ field.text }}{% endcapture %}{% endif %}{% endfor %}
{% for field in fields %}{% if field.label == 'Due date' %}{% capture due_date %}{{ field.text }}{% endcapture %}{% endif %}{% endfor %}
{% capture if_due_date %}{% if due_date == null %}.{% else %} due by {{ due_date }}.{% endif %}{% endcapture %}
{% for total in table.totals %}{% if total.label == 'Balance due' %}{% capture balance_due %}{{ total.text }}{% endcapture %}{% endif %}{% endfor %}
{% capture if_balance_due %}{% if balance_due == null %} {{invoice_total}} {% else %} {{ balance_due }} {% endif %}{% endcapture %}
<b>{{ recipient.name }},</b>
Please find attached your Invoice Number <b>{{ reference }}</b> dated <b>{{ invoice_date }}</b>
The Invoice amount is <b>{{ invoice_total }}</b>
Total balance due is <b>{{ if_balance_due }}</b>
Gives me, for example, Recipient,
Please find attached your Invoice Number 2404874 dated 15/01/2026
The Invoice amount is $ 244.05
Total balance due is $ 244.05
For anyone interested the code I’m using is as follows:
Subject
{% capture invoice_number %}{% for field in fields %}{% if field.label == "Invoice number" %}{{ field.text }}{% endif %}{% endfor %}{% endcapture %} Invoice {{ invoice_number }} from BUSINESS NAME
Body
{% for total in table.totals %}
{% if total.label == 'Total' %}
{% capture invoice_total %}{{ total.text | strip }}{% endcapture %}
{% endif %}
{% endfor %}
{% capture invoice_number %}
{% for field in fields %}
{% if field.label == "Invoice number" %}
{{ field.text | strip }}
{% endif %}
{% endfor %}
{% endcapture %}
{% capture due_date %}
{% for field in fields %}
{% if field.label == "Due date" %}
{{ field.text | strip }}
{% endif %}
{% endfor %}
{% endcapture %}
{% for total in table.totals %}
{% if total.label == 'Balance due' %}
{% capture balance_due %}{{ total.text | strip }}{% endcapture %}
{% endif %}
{% endfor %}
{% capture if_balance_due %}
{% if balance_due == blank %}
{{ invoice_total | strip }}
{% else %}
{{ balance_due | strip }}
{% endif %}
{% endcapture %}
Dear {{ recipient.name | strip }},
Please find attached Invoice {{ invoice_number | strip }} for the amount of {{ invoice_total | strip }}.
The outstanding balance of {{ if_balance_due | strip }} is due for payment by {{ due_date | strip }}.
If you have any questions or require further information, please don’t hesitate to contact me.
BUSINESS EMAIL SIGNATURE
I’m by no means an expert, so I will suggest using or modifying the code in my post above. I’m currently using this when I issue invoices, it does everything I need it to: client name, invoice number, total, remaining balance and due date.