Formatting Tags¶
Most email tags can be formatted a specific way by adding formatting information within the tag.
You can add formatting by changing any tag from [Detail.XXXX] to [Detail.XXXX(<type>(<format code>))]
Supported values for type:
datetimedecimalintegercurrency*sitecurrencyboolean**
Supported values for format code:
- Standard date/time format codes: http://msdn.microsoft.com/en-us/library/az4se3k1.aspx
- Custom date/time format codes: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
- Standard numeric format codes: http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
- Custom numeric format codes: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
*Special "currency" codes:
In addition to standard and custom numeric format codes, you can specify the currency by adding a pipe (or vertical slash) and the currency code, or "SiteCurrency".
Example
[Detail.Charges(currency(C|SiteCurrency))]
**Special "boolean" codes:
You can specify the actual words to use instead of "True" or "False".
Example
[Detail.MyCustomBoolField(boolean(Yes|No))]
Date Time Global Tag¶
The Date Time Global Tag can be used to display the time in a variety of formats.
[#now(DateTime(F))] - The date/time the email notification was generated.
The format string (by default "F") can be replaced with any standard .Net DateTime format string.
Note
These formats will utilize the email recipient's selected culture.
Standard Date and Time Format Strings¶
| Code | Example Output |
|---|---|
d |
6/15/2008 |
D |
Sunday, June 19, 2016 |
f |
Sunday, June 19, 2016 9:15 PM |
F |
Sunday, June 19, 2016 9:15:07 PM |
g |
6/19/2016 9:15 PM |
G |
6/19/2016 9:15:07 PM |
m |
June 19 |
o |
2016-06-19T21:15:07.0000000 |
R |
Sun, 19 Jun 2016 21:15:07 GMT |
s |
2016-06-19T21:15:07 |
t |
9:15 PM |
T |
9:15:07 PM |
u |
2016-06-19 21:15:07Z |
U |
Monday, June 19, 2016 4:15:07 AM |
y |
June, 2016 |
Alternatively, a custom format string containing any alphanumeric value, a ' ' (space), a ':' (colon) or a '/' (forward slash) may be used instead.
Example
The email tag [#now(DateTime(dd/M/yyyy))] will result in the value "15/6/2008"
Supported Values¶
- Standard date/time format codes: http://msdn.microsoft.com/en-us/library/az4se3k1.aspx
- Custom date/time format codes: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
Tilde Modifier (~)¶
The tilde (~) can be used as a prefix in an email template tag to turn off HTML-encoding. Email tags are normally HTML-encoded, but prefixing any tag in the email body with a tilde (~) will prevent HTML encoding.
Example
[Detail.Listing.Description] will be HTML encoded.
[~Detail.Listing.Description] will not be HTML encoded.
Note
The tilde does not work in the email subject.