Create a Campaign Message

  • Log in to your CrossEngage account.

  • Go to Campaigns and click "Create new campaign" in the top right corner of the page.

  • Choose whether you want to create an Audience or a Realtime campaign. Information about the distinction between these types of campaigns found here.

  • Once you have created your campaign and filled in the “Campaign setup” and “Target group” sections, go to the Messages section and click Create new message.

  • Select Webhooks from the dropdown menu. The message setup screen will open.

  • Under the “Send via integration” heading, select the Webhook that you set up earlier.

  • In Delivery Settings, select "Add URL part," and add the following to the destination URL: /Public_Hash_ID/survey_recipients . Please make sure that "/survey_recipients" is added after your public hash id.

The Public Hash ID is the same ID you copied while setting up your Zenloop Survey. You can find the Public Hash ID for all Surveys in your Zenloop Account in Settings -> zenAPI.

  • Fill in the Message box using JSON format. To better understand the possibilities of this integration, see the text below, which uses Handlebars as well.

Example JSON Message

{
  "send_at": "{{computeDate '{"timePhrase": "+ 0 day", "outputFormat": "yyyy-MM-dd"}'}}T{{computeDate '{"timePhrase": "+ 0 day", "outputFormat": "HH:mm:ss"}'}}Z",
  "recipient": {
    "identity": "{{user.[traits.email]}}",
    "identity_type": "email",
    "first_name": "{{user.[trait.firstName]}}",
    "last_name": "{{user.[trait.lastName]}}",
    "properties": [
      {"name": "country", "value": "{{user.[trait.country]}}"},
      {"name": "gender", "value": "{{user.[trait.gender]}}"},
      {"name":"ce_externalId","value":"{{user.[traits.externalId]}}"}
    ],
    "metatags": {
      "survey_question": "How likely are you to recommend %[question subject]?",
      "question_subject": "metatags",
      "request_for_comment_all": "Tell us a bit more about why you chose %[score] for metatags",
      "thank_you_link_text_all": "example text",
      "thank_you_link_url_all": "www.example.com",
      "thank_you_note_all": "Thanks for your feedback!"
    }
  }
}

Explanation of Example Text

  "send_at": "{{computeDate '{"timePhrase": "+ 0 day", "outputFormat": "yyyy-MM-dd"}'}}T{{computeDate '{"timePhrase": "+ 0 day", "outputFormat": "HH:mm:ss"}'}}Z",

This section of the example JSON text defines the time at which the message will be sent. This formulation will print year-month-date, and hour-minute-second. The ‘T’ and ‘Z’ in this formula is a requirement of zenloop’s ‘send_at’ format. Note that this section is not necessary: if not provided, the message will be sent anyway.

"recipient": {
    "identity": "{{user.[traits.email]}}",
    "identity_type": "email",
    "first_name": "{{user.[trait.firstName]}}",
    "last_name": "{{user.[trait.lastName]}}",
    "properties": [
      {"name": "country", "value": "{{user.[trait.country]}}"},
      {"name": "gender", "value": "{{user.[trait.gender]}}"},
      {"name":"ce_externalId","value":"{{user.[traits.externalId]}}"}
    ],

This section of the example JSON text defines the recipient of the message. The Handlebars in this message allow the recipient field to be personalized, inserting specific users’ email addresses, first names, last names, countries, and genders. For more information on Personalisation in CrossEngage, check our documentation here.

"metatags": {
      "survey_question": "How likely are you to recommend %[question subject]?",
      "question_subject": "metatags",
      "request_for_comment_all": "Tell us a bit more about why you chose %[score] for metatags",
      "thank_you_link_text_all": "example text",
      "thank_you_link_url_all": "www.example.com",
      "thank_you_note_all": "Thanks for your feedback!"
    }

This section of the example JSON text defines metatags, which are used for personalizations in Zenloop. The question in the above example would show, “How likely are you to recommend metatags?” For further information, check the Zenloop integration here

If the handlebars you have included in the message can't be resolved, webhook dispatch will fail.

Last updated