# Segmentation in Taxi

[Segment sets](https://docs.messagebird.com/taxi/Dynamic%20content,%20segmentation%20and%20personalisation/Segmentation/creating-and-managing-segment-sets) and [single segments](https://docs.messagebird.com/taxi/Dynamic%20content,%20segmentation%20and%20personalisation/Segmentation/creating-and-managing-single-segments) are defined in the segmentation section of your Taxi account. These allow you to set up rules to control which content is sent to the groups of people within this segmentation. They are then applied to any of the modules in your Email Design System to give you complete control of the specific content that’s sent to your customers.

This segmentation is mapped by the connector to handlebar code snippets, and this is run when the email is sent. This ensures each recipient gets the content selected for them.

![](https://downloads.intercomcdn.com/i/o/242520355/2f2b86f04038566eef862abd/Sengrid+%2B+Taxi.png?expires=1620729709\&signature=d4528049a93d054ed85c131fea9dcf747ebab31a6c71961ec36d77649735a476)

Once segments are defined it is possible to use them in the Taxi editor and to preview content for each segment.

Finally, to be able to export code through the connector, the handlebar code for segments must be added. This code is set per connector. This means you can use different rules between environments, so you can work with different data structures and formats in your different environments if needed.

Code for segments is entered through the segmentation settings.

In SendGrid there are multiple ways that you can use conditional logic. [Here](https://sendgrid.com/docs/for-developers/sending-email/single-sends-2020-update/) is a list of what is supported via the connector.

## Segmentation With Handlebars

The following describes what segmentation notations can be used within Taxi when segmenting with Sendgrid.

| <h3>Handlebar Notation</h3> | <h3>Utilised in Taxi</h3> |
| --------------------------- | ------------------------- |
| If                          | ✅                         |
| Else if                     | ✅                         |
| Equals                      | ✅                         |
| Not equals                  | ✅                         |
| unless                      | ✅                         |
| and                         | ❌                         |
| or                          | ❌                         |
| greaterThan                 | ❌                         |
| lessThan                    | ❌                         |
| Length                      | ❌                         |

\
\
When setting up the segment set or single segment with the Sendgrid connectors you can choose from the supported operators from a dropdown.

![](https://taxi-for-email.intercom-attachments-7.com/i/o/335459909/c4ab0519ce09bf2a1a761fb1/MeZDq7ga2XVoL6s1fJb1x28XTCqFze0yIeOvslRBmeHmy5G5XU33t0ERp7wQMKTDDtIQgG3hew_AUJ3ZqUMGZSa3I6kIeWAikqWiau5pT5lA_ABQzvrxDFlLO4GA7I-jafYn22Rq?expires=1620729709\&signature=b3e103955fcb1c61c297ae4cc4c3765700f4ab0b5db8940862588a29bcbfee79)

\ <br>


---

# 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://docs.bird.com/taxi/connectors/sendgrid-connector/setting-up-segmentation-for-sendgrid.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.
