Text
prefix and suffix
prefix e suffix sono attributi di formattazione applicabili a qualsiasi tag: aggiungono una stringa rispettivamente prima e dopo il valore reso.
[contact:EMAIL prefix="<<" suffix=">>"] → Prints the contact email address preceded by << and followed by >>
Left e right
| Attribute | Description | Example | Result |
|---|---|---|---|
left | First N characters | [contact:EMAIL left=3] | a@b (considerando l'indirizzo a@b.it) |
right | Last N characters | [contact:EMAIL left=4] | b.it (considerando l'indirizzo a@b.it) |
Multiple attributes can be chained and they also work on numeric values:
[contact:EMAIL left=4 prefix="**" suffix="**"] → prints the string **test**
| Tag | Valore campo | Result |
|---|---|---|
[contact:EMAIL prefix=">>>"] | a@b.it | >>>a@b.it |
[contact:EMAIL suffix="<<<"] | a@b.it | a@b.it<<< |
[contact:EMAIL prefix="[" suffix="]"] | a@b.it | [a@b.it] |
[contact:EMAIL prefix=">>>" suffix="<<<"] | empty | (empty string) |
[contact:EMAIL left=4 prefix=">>" suffix="<<"] | paolo… | >>paol<< |
[contact:EMAIL prefix="€" suffix=",00"] | 1500 | €1500,00 |
The print command transforms text. Multiple transformations can be chained in the same print:
[contact:EMAIL print="trim,lowercase"] → stampa la stringa Test@magnews.com
Valore in print | Effect |
|---|---|
trim | Removes leading/trailing spaces |
uppercase | Uppercase |
lowercase | Lowercase |
capitalize | Capitalize |
base64 | Base64 encoding |
md5 | MD5 hash |
sha1 | SHA-1 hash |
sha256 | SHA-256 hash |
sha512 | SHA-512 hash |
If you use base64, md5, sha1, sha256, sha512 the encoding oltre a quello print. Specificare il parametro di "encoding" allows you to use different encodings such as: "utf-8" (di default se non specificato), "utf-16", "windows-1252" o codificare caratteri speciali con caratteri ASCII a 7 bit.
[contact:EMAIL print="sha256"] → stampa la stringa ee12e84b6c09f8992486c86da38d0bf146779a2c5d552d56c296a0295ff0a6ca
encode
The encode command outputs the string using the specified encoding.
| Attribute | Description |
|---|---|
encode='encodehtml' | Replaces special html con le entity xml equivalenti. |
encode='encodejs' | Replaces special javascript. |
encode='urlencode' | Encodes the value as a URL parameter. |
renderplaceholders | Resolves any smart tags contained in the resulting value |
Dates and numbers
Format the pattern parameter according to these rules:
| Attribute | Example | Effect |
|---|---|---|
pattern | pattern="dd/MM/yyyy" | Date format (default dd/MM/yyyy) |
pattern | pattern="unix_timestamp" | Prints the Unix timestamp |
timezone | timezone="Europe/Rome" | Timezone used for date formatting |
locale | locale="it-IT" | Locale for dates/numbers |
maxdigits | maxdigits="2" | Maximum number of decimal places |
mindigits | mindigits="2" | Minimum number of decimal places |
grouping | grouping="true" | Thousands separator |
nan | nan="-" | Text printed if the number is invalid |
- d: giorno del mese;
- dd: giorno del mese rappresentato sempre con due cifre;
- ddd: giorno del mese con 0 davanti;
- dddd: giorno del mese con 00 davanti;
- EEE: giorno della settimana abbreviato in lettere;
- EEEE: giorno della settimana per esteso in lettere;
- M: mese dell'anno;
- MM: mese dell'anno rappresentato sempre con due cifre;
- MMM: mese dell'anno abbreviato in lettere;
- MMMM: mese dell'anno per esteso in lettere;
- yyyy: anno;
- YYYY: anno della settimana corrente (nota: l'ultima settimana dell'anno potrebbe ritornare l'anno successivo);
- H: orario;
- HH: orario rappresentato con due cifre;
- m: minuti;
- mm: minuti rappresentati sempre con due cifre;
- s: secondi;
- ss: secondi rappresentati sempre con due cifre;
- h: orario (in formato am/pm);
- a: aggiunge il marker AM/PM;
- w: stampa il numero di settimana dell'anno;
- z: stampa il timezone di riferimento;
- zzzz: stampa il timezone di riferimento in versione estesa.
Example using a date/time contact field:Data e ora [contact:CAMPODATAORA pattern='dd/MM/yyyy HH:mm']
Multiple choice
To print multiple values you can use the following attributes:
| Placeholder | Description | Example |
|---|---|---|
| separator | Character used as separator. | separator=',' |
| prefix | Prints a string before a value. | prefix="" |
| suffix | Prints a string after a value. | suffix="" |
[contact:interessi separator="," prefix="I suoi interesssi sono:"]Lists
When the smart tag returns a collection, prefix, suffix e separator control how the list is serialized. The default values match Java's toString di una lista Java:
| Attribute | Default | Purpose |
|---|---|---|
prefix | [ | List opening string |
suffix | ] | List closing string |
separator | , | Separator between elements |
max | — | Maximum number of items to display |
Example: to obtain uno; due; tre from a list:
[temp:mialista prefix="" suffix="" separator="; "]