SmartTemplate4

ATTENTION: This information is based on the latest Add-on version.
Maybe your installed version didn't contain all the variables listed here, please refer add-on help for further details!
From 0.9.3 and onward we have a new logic of our Variables, please use the NEW ones from now instead of the OLD ones!

Common

TIP: Some variables cannot be used when composing new mails; a message will be displayed should you chose one accidentally.

variable can be used always, including New E-Mails
variable can be used in New Emails, creating a clickable field
variable can only be used in Forward / Reply cases

Obsolete Variables

Fixed variables

Recipient (To)

TIP: When the name is not available, email address will be displayed instead

Sender (From)

TIP: When the name is not available, email address will be displayed instead

Recipient (CC)

TIP: When the name is not available, email address will be displayed instead

Optional Sections

ATTENTION: Sections inside square brackets [[Cc: %cc(name)%]] will only be displayed if the variable %cc(name)% can be found in the header and replaced successfully!

Example: To: Alex Cc: Fred - if Cc is missing, everything within the brackets will be omitted.

The following variables can be used inside square brackets [[...]]:

Subject

Special Headers

Signature (read from Account Settings)

By Default you can place the Signature by Account Settings in Thunderbird.

Account settings for signature

and remove the Signature delimiters '--' by our Global settings Tab.

Signature delimiter

But with follow variables you can override this positioning and use the variable with or without the delimiters.

Language functions

%spellcheck(language)% = change automatic proofing / spellcheck language. The language parameter can be any locale string of a dictionary that is already installed, e.g. en, de, en-GB etc. Examples for language: cs, de, en-US, es-ES, fi, fr, id-ID, it, ja, nl, oc, pl, pt-BR, ru.
Additional dictionaries can be installed from addons.thunderbird.net using Add-ons Manager. See also [issue 17]

You can also toggle spellcheck using %spellcheck(on)% or %spellcheck(off)%. Normally the global Thunderbird setting under Composition / Spelling "Enable Spellcheck as you type" will apply. To toggle (on or off) and set the language, write the toggle command first.

Example:
%spellcheck(on)%
%spellcheck(de)%
This turns on automatic proofing and switches the spellchecker language to German.

%language(localeId)% Requests a language for certain Calendar functions.

The functions %A% %a% %B% %b% retrieve day / month names from the locales supplied with SmartTemplate⁴
localeId = [cs, de, en-US, es-ES, fi, fr, id-ID, it, ja, nl, oc, pl, pt-BR, ru, sl, sr, sv-SE, uk, zh-CN, zh-TW]

The functions %dateshort% %datelocal% resolve their date formats from the currently installed language packs - see the Languages tab in Add-on Manager to see available locales.

In case of problems / unexpected language results, check the JavaScript error console for details. This can be opened with the shortcut CTRL+SHIFT+J or via Error Console in the Tools - Developer Tools Menu in Thunderbird.

In order to download additional language packs for Thunderbird, please go to https://ftp.mozilla.org/pub/thunderbird/releases/ then find a matching version for your Thunderbird / OS, then open the xpi folder for language packs.
Example: https://ftp.mozilla.org/pub/thunderbird/releases/60.8.0/win64/xpi/ contains matching language packs for Thunderbird 68.8.0 for Windows 64bit and can be dragged directly into the Add-ons Manager.

Combined variables for 'Date format' / 'Timezone'

TIP: Can be combined with %X:=sent%

Variables for customized 'Date format'

TIP: Can be combined with %X:=sent%

Calendar Week (based on ISO 8601)

TIP: %cwIso(offset)% the 'offset' represents what you count as first day of the week. Typically, in Europe you would probably use %cwIso(1)% (for Monday), in Northern America %cwIso(0)% (for Sunday)

The %X:=sent% Modifier

By Default, Date/Time variables will always be initialized with current values (current = the time when you create the email).
When combined with %X:=sent%, the date/time variables will reflect the original messages date/time.

Example for a longstring:

TIP: Result Sunday, 20.12.2011 16:24 +0100

Example of a shortstring:

TIP: Result Sunday, 20.12.2011 08:54:21

The following variables can be used in both variants:

String Manipulation

Note: the new %matchTextFromBody% and %matchTextFromSubject% functions use regular expressions - these are powerful keys for finding text patterns. The first parameter must be the regular expression within double quotes. The second parameter is a number which denotes the "match group". Match groups are usually designated with round parentheses (). Use 0 to match the complete expression, 1 for the first group etc.

To learn about regular expressions, please visit: www.regular-expressions.info. For testing your patterns, I recommend this online tester: regex101.com

Mail Header Manipulation

The following functions can be used to modify header fields such as the "To:" line of the email so that the Email is autopmatically sent to a different recipient. They are included in SmartTemplate⁴ Pro for unlimited use. Read up on the full functionality on the premium features page.

Examples

Setting Priority

%header.set(priority,Priority)% = Change priority of Email. See also [Bug 26689]

Examples:

%header.set(priority,highest)%
%header.set(priority,high)%
%header.set(priority,normal)%
%header.set(priority,low)%
%header.set(priority,lowest)%

Inserting HTML files and Images

The %file()% functions can be used for inserting images or HTML / text files which can even contain more SmartTemplate⁴ variables. They are included in SmartTemplate⁴ Pro for unlimited use. Read up on the full functionality on the premium features page.

Note for templates

ATTENTION: Templates which use <br> tags should be used with "Replace new-line with <br>" option deactivated
and Templates without the <br> Tags included should be used WITH the option "Replace new-line with <br>" activated!

Note for HTML templates

ATTENTION: Please use only UTF-8 (Unicode) charset inside HTML templates!
A UTF-8 encoding table can be found here.