The quick answer
For a merge field that supplies a date value in a scriptable email template, add an explicit date format to the exact merge field supplied by that template context. This example uses ${transaction.tranDate?string['dd/MM/yyyy']}. Save the template, reopen Source code to check it, then select the template on the same saved invoice and inspect the merged message.
Person and operating-company names in these screenshots are fictional example data.
Before you start
You need a role that can edit the template, view the invoice and open its email composer. Available source controls, merge fields and composer actions depend on the account features, role, template type and record context. This walkthrough uses an existing Transaction scriptable email template named Invoice Date Notice.
The template is reusable: saved edits affect later messages that select it. Use a controlled test template and preserve the original expression before changing a shared version.
The expression below assumes the merge value is a date. If your context supplies a preformatted string, confirm its input format before parsing it. Do not infer the value's type from how a date looks in the invoice form.
Use the exact field token inserted or supported by your scriptable email template. Here it is transaction.tranDate, with an uppercase D in the field name. The format mask dd/MM/yyyy uses lowercase dd and yyyy, and uppercase MM. Advanced PDF/HTML templates use a different data model; do not swap their field paths into this email expression.
01. Check the initial merge
Open saved invoice INV-9412 for Aspen Field Supply. Its displayed date is 11/23/2026, November 23.
From the invoice, open its email composer and select Message. In this example, the action is under Communication > Messages > Email. Select Invoice Date Notice. The composer initially shows Invoice date: 11/23/2026. This is an unsent message.
Click Cancel before editing the reusable template.
02. Format the date expression
Open Documents > Templates > Email Templates and edit Invoice Date Notice. Confirm Record Type: Transaction, then open Source code on the Template tab.
Replace only ${transaction.tranDate} with:
${transaction.tranDate?string['dd/MM/yyyy']}
Keep the surrounding HTML unchanged. The quotes must be literal, the brackets must match, and the final } must remain.
03. Save and reopen Source code
Click Save. Edit the same template again and reopen Source code. Confirm that the complete expression is still stored, including the literal quotes and closing brace.
A saved placeholder is only a persistence check. You still need to test it in the invoice's merge context.
04. Verify the same invoice
Return to INV-9412. Its displayed transaction date remains 11/23/2026.
Open Communication > Messages > Email > Message and select Invoice Date Notice. In this example, the merged body now shows Invoice date: 23/11/2026. Confirm the same invoice number and customer alongside it.
The expression changes the message's date presentation. It does not change the invoice date or account preferences. Do not click Merge & Send; inspecting the composer checks this invoice and merge context without sending a message. If the date is blank, unchanged or produces an error, check the supported field token and value type before sending.
Common questions
Why does the date-format expression fail on a value that looks like a date?
A formatted string and a date value have different types. The date-format expression requires a date. If the input is known to be a US-format string such as 11/23/2026, parse it with the matching MM/dd/yyyy input mask before applying dd/MM/yyyy. Do not use that parsing mask for an unknown or differently formatted string.
Are square brackets or parentheses required after string?
FreeMarker supports both square-bracket and function-call forms for a date format. This example preserves the square-bracket form. Valid syntax alone does not establish the merge value's type or the correct field path.
Why do quotes become HTML entities when I save the template?
Inspect the saved Source code. If the editor changes the expression's quotes or delimiters, restore the literal FreeMarker syntax and test it again. HTML entities elsewhere in the HTML can be valid; the concern is malformed template syntax. If the editor keeps rewriting valid source, a file-based template may be an alternative where that template type and workflow are available.
Can I use record.trandate instead of transaction.tranDate?
Use the exact field supplied by the template's merge context. Advanced PDF/HTML templates commonly use record.trandate. That does not make it interchangeable with the scriptable email field used here. Preserve the supported field's case.
Does saving the template prove the merged content and delivery are correct?
Saving proves the source was stored. Select the template on the saved invoice and inspect the merged content to check the actual invoice context. That inspection does not validate the recipient address or prove delivery; this walkthrough stops without sending.