/
How to use Mustache Template

How to use Mustache Template

In this document, you will learn how to use Mustache Template. The Mustache is a logicless template used for creating Dynamic content

Mustache Tag:

Mustache tags are denoted by double curly braces surrounding the tag key.

Example:

{{msg.sample}} - Here msg.sample is the tag key.

 

Mustache Template:

  • The mustache template is a string that contains any number of mustache tags

  • The tag could be used as a placeholder and it will be replaced with the value during the run time. This will help to render dynamic values.

Example:

The value stored in the msg.sample will be evaluated in the runtime

 

Using URL or links in Mustache:

  • All the mustache tags are HTML escaped by default.

  • So If we don't want it to be HTML escaped, we might need to use “triple stash” or “&” like {{{ expression }}} or {{&expression}}

  • This would be helpful when sending links through SMS or Email.

Example:

The value in msg.sampleLink will be parsed

 

 

Related content

Send Email Node
Send Email Node
More like this
Card Directive and its components
Card Directive and its components
More like this
How do I use directives?
How do I use directives?
More like this
Allowed HTML Tags and Attributes in the chatbot response-text
Allowed HTML Tags and Attributes in the chatbot response-text
More like this
How do I use tokens?
How do I use tokens?
More like this
How do I customize an email template?
How do I customize an email template?
More like this