Conditional Email Triggers

Under normal use, email triggers simply fire based on survey completion, but with clever use of skip logic and piping, you can create triggers that are conditional on the response to specific questions. The way to do this is reasonably simple, but we suggest reading up on Skip Logic and Piping first.

Using Conditional Email Triggers relies on two things:

  1. You can pipe a value into the To Email field of an email trigger
  2. if this field is blank when a survey is completed, the email won’t trigger.

So, by making the contents of this field conditional on a specific survey answer, we can make the sending of the mail conditional on that answer. The way we're going to make the contents of that field conditional on the answer to a question is by using Skip Logic to control whether the respondent is routed through a specific page that has a hidden question on it.

For this example, lets assume we’re running a simple customer satisfaction survey, and we want to follow-up and send emails when a respondent gives a very low score to a Net Promoter® Score question – zero, one, or two.

Set up The Survey Pages

  1. Click on Design
  2. Create separate pages for the question you want to use to determine whether a respondent is contacted or not (page 1), and a destination page for respondents you want to contact (page 2)

Create the Routing Question

For this example, it's a Net Promoter question, but the core method will work for any type of questions.

  • On Page 1, click Add Question
  • Under Question Type select Net Promoter® Score 
  • Under Question Text use the drop-down menu to select the relevant choice from: "this company", "this product", "this service", "this brand" or "other".
  • Click Add Question

Set Up the Skip Logic

We need to create skip logic that will control whether the page that defines if the trigger sends will display or not. In the case of the example, this is page 2 and we want send the trigger on a low score (0, 1, or 2).

  • Select Skip Logic on the question you have just created, then:
    • Add New Rule 
      1. For Condition select choice is not one of the following
      2. For Choice select 0, 1 and 2.
      3. For Action select Finish Survey 
      4. Click Save (Green button) to save the rule.
    • Add New Rule (again) 
      1. For Condition select choice is one of the following
      2. For Choice select 0, 1 and 2.
      3. For Action select Jump To Page
      4. For Page select 2
      5. Click Save (Green button) to save the rule.

Set Up The Trigger Control Question​

  • On Page 2, Click Add Question Here​
  • Under Question Type select Single Textbox
  • Add second question - This won't be seen by respondents, so you can type anything here. For this example we'll use 'Hidden Q for Email Trigger'
  • Select the Options tab for the question.
  • Under "Advanced Options" toggle the CSS Class option to "on" and type the word "hidden" in the box in all lower case (Important! do NOT use the 'hide question' tickbox as this won't do the same thing and your trigger won't work). See the screenshot below for an example.

To keep this guide simple, we haven't put any other questions on page 2. However this means that the survey will have what looks like a blank page on page 2. This isn't great for respondents so it's a good idea to put a genuine question on the page the trigger control question is on. An obvious suggestion is a follow-up question asking for more detail relating to the score provided on the previous page.

Populating the Trigger Email Address

Fixed Address:

If the Emails are all going to the same address, then you simply need to enter the target address in the "Default Answer" box.

Variable Address:

To have a variable target for the trigger that will vary for each respondent, you'll need to set up some piping for the address.

  • Still in the question options tab, set the Default Answer toggle to on.
  • In the click in the empty box that appars to open the piping dialogue and click Insert piping
  • In the piuping dialogue box, choose where your respondent's email address is coming from. If the survey has been sent via the Email Tool, select Email Address at the bottom under Email Invite Contact. If you have used a custom variable, you will need to find the name of the variable in the drop-down list ​

Other use cases might involve piping the target address from a custom column or the answer to a question.

Setting up the Email Trigger

A fuller guide to setting up the Email Trigger can be found here, so you should follow the instructions in that guide. The key difference is with regards to the To Email field.

  1. Click Insert piping then choose the hidden question from the drop-down menu (see below) and click "Insert".
    The Piping Drop-down in the Email Trigger setup. "Hidden Q for Email Tirgger" is highlighted
  2. The field will read "[question(1234567)]", with the numbers being the unique ID of the chosen question
  3. Enter Sender Display Name and Subject
  4. Click Save Email Trigger
  5. And then it’s done!

Testing

For the trigger to work, the survey needs to be set to open, as it relies on response data being recorded to populate the trigger and this won't be the case in preview mode. While this will put actual response data into your survey, you can clear these responses before putting the survey out live.

It can be good practice to leave the "hidden" question unhidden for the first few tests as you'll be able to check the state of the default answer. You can then re-hide it as per step 5 of the "Set up the trigger control question" section.

For a trigger set up for a static address, you can test by simply opening the survey and completing the survey (and looking for the emails in the target mailbox).

If you're populating the field from a contact list or custom variable, you’ll need a means of populating the hidden field. This means you’ll need to either create a small email invitation for your testers as if it was live when using the contact list, or add the variable to the URL if using a custom variable.

This is the simplest possible example, but there is plenty of scope to extend beyond this. You can create multiple email triggers, dependent on different answers - or even on answers to different questions.  Using this same method, you can create triggers that will direct users, based on their answers, to pages where contact details are piped in to a hidden question and then piped into the To Email field of each trigger.


Was this guide helpful?