Mustache

Getting Started with Mustache

Prerequisites

A source of variables that will be used for creating result text using the Mustache template.

We can use Google Sheets for this purpose.

To work with Google Sheets, you have to have a Google account. If you do not have one, you can create a Google account at https://accounts.google.com.

Mustache

For more details about the Mustache template system, please visit the Mustache official website.

 

Adding a Mustache Module to your Scenario

1. Click on the blue button, Create a new scenario in the top-right corner of Integromat’s Dashboard page or Scenarios page

2019-01-09_10_40_05-Window.png

2. Search for the Mustache module using the search field

3. Select Mustache by clicking on the module's icon

4. Click on the Continue buttonmCphEvr1JC.gif

    5. Your scenario is now open

6. Start by clicking on the white question mark icon in the center of your scenario

7. Select Mustache from the menu

Transformers

Compile a Template

Mustache is a simple template system allowing you to generate output content from the provided template with variables.

To demonstrate what the module does, we will generate a short party invitation sent by email.

2019-01-08_11_40_36-Integration_Google_Sheets__Mustache__Gmail___Integromat.png

 

 

Template Create the desired Mustache template in this field. Use variables as required and close them into double curly braces {{}}. These braces are called mustaches.
Variables Now you have to define the variables used in your text above. We have used four variables in mustaches in our sample template. These variables are name, date, time and place.

Setting Up Variables in the Mustache Module

1. Click on the Add item button in the Variables section

2019-01-08_12_04_01-Integration_Mustache___Integromat.png

2. There are two fields in the Add item dialog – Key and Value.

Key Enter a variable used in your template. Do not use curly braces.
Value

Specify the source of the variable. We have used the Google Sheets module, Watch a Worksheet trigger and have chosen the Events table from where to load the variables.

2019-01-08_12_30_52-Integration_Mustache___Integromat.png

When someone enters values into the table, these values will be used as variables for our Mustache template.

ujY0tkDRBE.gif

Setting up a variable in the Mustache module

LRhFTqJ1M8.gif

Now, when the source of variables (using the Google Sheets module) and all needed variables in the Mustache module are set, we should decide what to do with the resulting text we get as output from the Mustache module.

As an example, we will send an email with our invitation.

Setting up a Target for the Mustache Template

Mustache, as a transformer module, cannot be the last in the scenario.

1. Add another module after the Mustache module

2. It can be the Email module, for example

2019-01-08_13_44_42-Integration_Mustache___Integromat.png

3. Select the Send an email action

2019-01-08_13_49_15-Integration_Mustache___Integromat.png

Send an email action settings

1. Ensure that a connection to your email is established (to establish a connection to the email module follow instructions in the Email documentation)

2. Add recipients of the invitation in the To field

3. Enter the subject of the email into the Subject field

4. Add the Mustache module Compile a template action to the Content field

2019-01-08_14_07_57-Integration_Mustache___Integromat.png

The result of our sample Mustache scenario:

2019-01-08_14_13_22-Christmas_party_invitation_-_ondrej.tesar_integromat.com_-_Integrators.cz_Mail.png

Activating a scenario

Once your Mustache scenario is tested and ready to use, you have to activate it.

Activate your scenario by following Step 4 in the Creating a scenario article.

Popular use cases from our blog

slack-automation-illustration

Slack Automation: 20 Free Templates to Get You Inspired

google-sheets-automation-alt

Google Sheets Automation for Ecommerce: 23 Free Templates

tweet-automation-illustration

How to Get Someone's Tweets Before Anyone Else Does

onboarding-automation-with-integromat-alt

How to Automate Employee Onboarding in Minutes with Integromat

shopify-order-to-manufacturer-illustration-alt

How to Auto Send Shopify Orders to Dropshipping Suppliers [Guide]

strava-exercise-to-google-sheets-illustration

Like a Champ: How to Save Strava Activities to Google Sheets

Didn’t find what you were looking for?

Ticket

Create a ticket

Contact our world-class support team and tell us what’s happening.

Create a ticket
Expert

Find an expert

We feature a network of 450+ certified partners across the globe who are ready to help

Find an expert

Automate any workflow in your business

Sign up for a free account today. No credit card required, no time limits on free plan.