The following is a non-exhaustive list of the most used parameters and placeholders in the Giotto language.
A parameter can be defined by adding the attribute <mn:param>
in an HTML tag and specifying its ID using <mn:name>
<meta mn:param mn:name="myparam"/>
.
To print a parameter or variable, write: [param:name{defaultValue}]
.
Parameter | Description | Example |
---|---|---|
contact | Print the value of a contact field. | [contact:idfield] |
contactstats | Print statistical data of a contact related to the email channel. | [contactstats:sent] [contactstats:received] |
var | Print a global, contextual, or database variable. | [var:mydatabasevariable] |
ico | Print a system icon. | <img src="[ico:facebook]"> |
message | Print the value of a message. | [message:fromname] |
translate | Print the translation of a variable/string. | [translate:myvariable] |
link | Print a system link. | [link:unsubscribe] |
Contact
Placeholder | Description |
---|---|
[contact:NAME] | Print the value of the field with ID "NAME". |
[contact:IDCAMPO$colonna1] | Given a contact field of simple relationship type with ID "IDCAMPO" and a data table linked to the field that has the column "colonna1", print the value of "colonna1" for the contact. |
[contact:IDCAMPO$colonna1 orderby='cod asc'] | Given a contact field of many-to-many relationship type with ID "IDCAMPO" and a data table linked to the field that has the column "colonna1", print the first value found ordered by the column "cod". |
[contact:IDCAMPO$colonna1 where='cod=20'] | Given a contact field of many-to-many relationship type with ID "IDCAMPO" and a data table linked to the field that has the column "colonna1", print the value found in the record with the column "cod" equal to 20. |
[contact:IDCAMPO$colonna1 where='cod eq \'cravatta\''] | Given a contact field of many-to-many relationship type with ID "IDCAMPO" and a data table linked to the field that has the column "colonna1", print the value found in the record with the column "cod" equal to "cravatta". Note: use single quotes and the \ as an escape, as shown in the example; do not use double quotes. |
Contactstats
Placeholder | Description | Example |
---|---|---|
[contactstats:sent] | Displays the number of emails sent. | contact.stats.sent |
[contactstats:received] | Displays the number of emails received. | contact.stats.received |
[contactstats:opened] | Displays the number of emails opened. | contact.stats.opened |
[contactstats:clicked] | Displays the number of emails clicked. | contact.stats.clicked |
[contactstats:forwarded] | Displays the number of emails forwarded. | contact.stats.forwarded |
[contactstats:lasttags] | Displays the list of the last clicked tags (click on Communications + Click on content). |
contact.stats.lasttags (string)mn:where='taglist like @contact.stats.lasttags'
|
Messages
Placeholder | Description |
---|---|
[message:fromname] | Displays the from name of the message. |
[message:fromemail] | Displays the from email of the message. |
[message:subject] | Displays the subject of the message. Note: to represent the subject of the message, any mn:init sections, which usually perform queries, will be executed again. |
[message:previewtext] | Displays the preview text of the message. |
[message:sentdate] | Displays the sent date of the message. |
[message:deliverydate] | Displays the delivery date of the message. |
[message:firstdeliverydate] | Displays the first delivery date of the message. |
[message:deliverydate pattern='dd/MM/yyyy HH:mm'] | Configures the date format of the delivery date of the message. |
[message:iddelivery] | Delivery ID, where applicable. |
[message:idnewsletter] | Communication ID, where applicable. |
[message:idcampaign] | Journey ID, where applicable. |
[message:idmessage] | Transactional message ID, where applicable. |
[message:description] | Message description for the contacts, set in the communication setup. |
[message:ref] | Token that uniquely identifies the message, and can be used to generate events using the API (see option "storeEvent" in the Contacts-related API). |
Link
Parameter | Description | Example |
---|---|---|
[link:unsubscribe] | Link to the unsubscribe flow. | <a href="[link:subscribe]" mn:if="friend">Subscribe</a> |
[link:subscribe] | Link to the subscribe flow. | <a href="[link:unsubscribe]" mn:if="not friend and contact.identified">Unsubscribe</a> The use of the condition <mn:if="friend"> shows the link only to unidentified contacts. The condition <mn:if="not friend and contact.identified"> makes the unsubscribe link visible only to identified contacts. |
[link:confirmsubscription] | Link to the subscription confirmation flow. | <a href="[link:confirmsubscription]">Confirm Subscribe</a> |
[link:editprofile] | Link to the profile editing flow. | <a href="[link:editprofile]">Edit profile</a> |
[link:webversion] | Link to the web version of the communication. | <a href="[link:webversion]">Web version</a> <a href="[link:webversion]" lang='ENG'>Web English version</a> |
[link:mobileversion] | Link to the mobile web version of the communication. | <a href="[link:mobileversion]">Mobile version</a> |
[link:forwardnewsletter] | Link to the forward-to-a-friend flow of the communication. | <a href="[link:forwardnewsletter]">Forward to a friend</a> |
[link:sharenewsletter] | Link to the communication sharing flow on social networks. | <a href="[link:sharenewsletter social='facebook']">Share on Facebook</a> <a href="[link:sharenewsletter social='twitter']">Share on Twitter</a> <a href="[link:sharenewsletter social='linkedin']">Share on LinkedIn</a> |
[link:sharelink] | Link to share an external link on social networks. | <a href="[link:sharelink social='facebook' href='http://mydomain.com']">Share on Facebook</a> <a href="[link:sharelink social='twitter' href='param.mylink' text='Text on twitter']">Share on Twitter</a> <a href="[link:sharelink social='linkedin' href='param.mylink']">Share on LinkedIn</a> |
[link:forwardcontent] | Link to forward a specific content to a friend. | <a href="[link:forwardcontent]">Forward to a friend</a> |
[link:sharecontent] | Link to share content on social networks. | <a href="[link:sharecontent social=' facebook']">Share content on Facebook</a> <a href="[link:sharecontent social=' twitter ']">Share content on Twitter</a> |
Text formatting
You can format the value of each placeholder in different ways.
Multiple choice
Placeholder | Description | Example |
---|---|---|
separator | Character used as a separator. | separator=',' |
prefix | Outputs a string before a value. | prefix='' |
suffix | Outputs a string after a value. | suffix='' |
Workflow variables
You can display the value of a workflow variable.
Placeholder | Description |
---|---|
[workflow:id_variabile] | Displays the value of a workflow variable. |
If the workflow variable is called id_variabile and in the placeholder you refer to it with the syntax: [workflow:ID_VARIABILE], it will not render correctly.
Encoding
You can define specific encoding based on user needs.
-
encode="encodejs"
: replaces javascript characters -
encode="urlencode"
: encodes the value as a URL parameter.
Example:
<meta mn:param mn:name="text" mn:type="text" mn:default="; à é & '" />
[param:text]
[param:text encode='encodehtml']
[param:text encode='encodejs']
[param:text encode='urlencode']
Using placeholders in CSS blocks
Within CSS (Cascading Style Sheets) code, the typical square bracket placeholder syntax like [param:backgroundcolor] cannot be used directly.
To solve this issue, two syntaxes are available:
- Comments to replace the entire value of an attribute:
color: blue /*[param:color]*/
- Comments to replace part (token) of a value of an attribute:
border: 1px solid /**[param:bordertype]*/ blue /**[param:color]*/
If you use the regular comment, i.e., '/* ... */', then Giotto replaces the comment with the attribute's value.
If you use the comment with double asterisks '/** ... */', Giotto replaces only the part preceding the comment.
Currently, there is no syntax to manage the qualifier '!important'
Pay attention and consider that for sending email messages, the "Inline CSS" technique is usually applied, meaning that Giotto will include all rules defined within the <style> tags in the 'style' attributes to improve compatibility with different email clients.
Complete example:
<style>
.myClass {
/* Replace the entire value */
color: blue /*[param:color]*/;
/* Replace 'solid' and 'blue' independently */
border: 1px solid /**[param:bordertype]*/ blue /**[param:color]*/;
}
</style>