# 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.

<figure><img src="/files/DvQlgHZCTkPXaSHxJwDz" alt=""><figcaption></figcaption></figure>

* Choose whether you want to create an Audience or a Realtime campaign. Information about the distinction between these types of campaigns found [here](/data-and-engagement-platform/campaign-management/campaigns.md).
* 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.

<figure><img src="/files/ZHwaA2pPM411xcop5D4f" alt=""><figcaption></figcaption></figure>

* 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.

<figure><img src="/files/6dgNkASm8TH6XOHPZR3x" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The Public Hash ID is the same ID you copied while [setting up your Zenloop Survey](/data-and-engagement-platform/messages/integrations/channels/webhooks/zenloop-via-crossengage-webhook/set-up-zenloop-survey.md). You can find the Public Hash ID for all Surveys in your Zenloop Account in Settings -> zenAPI.
{% endhint %}

* 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**

{% code overflow="wrap" lineNumbers="true" %}

```json
{
  "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!"
    }
  }
}
```

{% endcode %}

### Explanation of Example Text

```json
  "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](/data-and-engagement-platform/messages/personalization.md).

```
"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](https://docs.zenloop.com/docs/metatags-implementation)

{% hint style="danger" %}
If the handlebars you have included in the message can't be resolved, webhook dispatch will fail.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.crossengage.io/data-and-engagement-platform/messages/integrations/channels/webhooks/zenloop-via-crossengage-webhook/create-a-campaign-message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
