Create a Campaign Message
Last updated
Last updated
Log in to your CrossEngage account.
Go to Campaigns
and click Create new campaign
in the top right corner of the page.
Choose an Audience campaign.
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 Webhook
from the dropdown menu. The message setup screen will open.
Under the “Send via integration” heading, select the webhook that you set up earlier.
If you are using different endpoints, you can add the specific URL part in the "Delivery Settings" section, instead of making a new integration for it.
If you are using different endpoints you can add the specific URL part by checking the ? the "Delivery Settings" section instead of making a new integration for it.
Under "Message Content" you will find the JSON text you set up in the Integration step. You can add more text depending on your needs.
Put the following code in to the "Message Content" field:
{"email": "{{batch:email}}"}
Adjust the code to include your desired user attribute by changing the name of the user attribute or handelbar. For example, you can write "firstName" instead of "email", which would appear as
{"firstName": "{{batch:firstName}}"}
.
Select the right variable in Value Mapping: you can select traits (user attributes) as well as handlebars.
Copy and paste the following code into the Message Content field:
{"users": "{{batch:users}}", "email": "{{batch:email}}"}
Adjust the code to include your desired user attribute by changing the name of the user attribute or handelbar. For example, you can write "firstName" instead of "email", which would appear as
{"firstName": "{{batch:firstName}}"}
.
Select the right variables in the Value Mapping section.
Copy and paste the following code into the "Message Content" field:
{"userattribute": "{{batch:userattribute}}"}
Select the right variables and substitute the handlebar below as the value for the "userattribute" variable:
{"email": "{{user.[traits.email]}}","country": "{{user.[traits.businessUnit]}}","address": "{{user.[traits.address]}}" }
This is how the webhook delivery should look like:
In similar fashion to a singular webhook, the users will receive "webhook.sent" event.
Make sure that the webhook URL is "https" not "http".
Make sure the other endpoint gives fallback as well.
If the endpoint has a restriction, such as not allowing an empty field, it might reject/fail a user. If one user is rejected, the whole batch will fail.
You can use waithook/hookbin to test. Please note that waithook will not give you https support - for this you can use hookbin instead.
Default content:
{"users": "{{batch:userupdate}}"}
Start your campaign. If you are using it for testing you can monitor it in hookbin with the endpoint which you have just created. You will see:
Request details (time etc)
HTTP HEADERS
QUERY STRING
BODY
FILE UPLOADS
COOKIES