# 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 `Email` from the dropdown menu. The message setup screen will open.

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

* Name the new email message.
* Under the “Send via integration” heading, select the SendGrid integration that you set up earlier.
* Fill in the Sender Information:
  * “Sender email address” - the address from which the email will be sent;
  * “Reply-to email address” - the address where replies will be sent to;
  * “Sender name” - the name of the message sender.
* Choose an existing template from SendGrid or create one in CrossEngage.
  * ​[Handlebars](/data-and-engagement-platform/messages/personalization.md) may be useful when creating templates in CrossEngage.
  * If you choose the SendGrid template, do not forget to map your values.

{% hint style="warning" %}
While you can use handlebars to personalize sender and reply-to email addresses in Sendgrid messages, personalization can only be applied to the local side of an email address (the part before the @), but not the domain part after the @.
{% endhint %}

## Value Mapping

Value-mapping fills out variables (called [substitution tags](https://docs.sendgrid.com/for-developers/sending-email/substitution-tags) in SendGrid) in your SendGrid template with personalized content adjusted for individual customers. **Note: CrossEngage only supports "Legacy Transactional Templates" in Sendgrid.**

For example, to include your customer’s first name in your SendGrid email, you would place the`[first_name]` standard substitution tag where you want your customer’s first name to appear in the content of the message. When your customer receives the campaign, they will see their own name where the merge tag was placed.

Apart from the reserved substitution tags that are preloaded into your account, you can also [create your own custom substitution tags ](https://sendgrid.com/docs/ui/managing-contacts/custom-fields/)and map them in the following structure: `[%EXAMPLE%]`. Write the variables in this structure, only substitute “EXAMPLE” with the Merge Tag you wish to use.

### Using Variables (Substitution Tags)

* Include the substitution tag of your choice in the content of your SendGrid Template. To ensure values are mapped correctly, follow the value-mapping structure outlined in the section above.&#x20;

<figure><img src="/files/2TZlEpc08xCjdRGLlTrh" alt=""><figcaption></figcaption></figure>

* Once your template is saved, you can use it in the CrossEngage campaign set-up. Select `+Add key` to add the variables that you have used in this particular campaign’s SendGrid Template. You can use both user attributes and handlebars to fill out your variables. SendGrid, unlike Mailjet, Mandrill and MailChimp, requires you to map the entire placeholder in CrossEngage. Therefore, when mapping variables in CrossEngage you have to copy the whole variable, in the same form as it is written in your SendGrid template (see the screenshot below).

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

{% hint style="info" %}
To learn more about the SendGrid Templates, check the [SendGrid Templates Documentation](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates).
{% 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/email/sendgrid-by-twilio/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.
