> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.zenskar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Segments

Segments module provides a comprehensive view of different customer segments created based on various filters. Segments module allows efficient management and customization of communication strategies for different customer groups.

## ⚙️ Create a segment

1. Navigate to **Communications > Segments** in the left side-panel.
2. You will arrive at **Segments** page.
3. Click on the **CREATE NEW SEGMENT** button.
4. In the **Add New Segment** page, add the following details:

   * **Segment name**: any user-defined string that describes the segment.
   * **Add filters to create a segment**: major filters types available are as follows:

   <br />

   <Table align={["left","left"]}>
     <thead>
       <tr>
         <th style={{ textAlign: "left" }}>
           Filter
         </th>

         <th style={{ textAlign: "left" }}>
           Sub-filters
         </th>
       </tr>
     </thead>

     <tbody>
       <tr>
         <td style={{ textAlign: "left" }}>
           Customer
         </td>

         <td style={{ textAlign: "left" }}>
           Customer Name\
           Customer Email\
           Custom Data\
           Connector Name\\
           Default Payment Method\
           Default Payment Method Status\
           Customer Country
         </td>
       </tr>

       <tr>
         <td style={{ textAlign: "left" }}>
           Invoice
         </td>

         <td style={{ textAlign: "left" }}>
           Status\
           Due date exceeded by(days)\
           Created after
         </td>
       </tr>

       <tr>
         <td style={{ textAlign: "left" }}>
           Payment method
         </td>

         <td style={{ textAlign: "left" }}>
           Type\
           Status\
           Connector\
           Is default
         </td>
       </tr>

       <tr>
         <td style={{ textAlign: "left" }}>
           Connector
         </td>

         <td style={{ textAlign: "left" }}>
           Name\
           Connection
         </td>
       </tr>

       <tr>
         <td style={{ textAlign: "left" }}>
           Monitor
         </td>

         <td style={{ textAlign: "left" }} />
       </tr>
     </tbody>
   </Table>
5. Click on the **CREATE SEGMENT** button to save the segment.

***

## 📚 Filters explained

A filter is used to create a segment of customers. A filter can be as simple as shown below.

<Image alt="Fig. 1: Create a simple segment based on a filter of type customer." align="center" border={true} src="https://files.readme.io/5c42988-image.png">
  Fig. 1: Create a simple segment based on a filter of type customer.
</Image>

You can add multiple filters of the same type, as shown below.

<Image alt="Fig. 2: Create a complex segment based on filters of type customer." align="center" border={true} src="https://files.readme.io/2eaa050-image.png">
  Fig. 2: Create a complex segment based on filters of type customer.
</Image>

You can also combine filters of different types to create a complex segment, as shown below.

<Image align="center" className="border" border={true} src="https://files.readme.io/90b7f32-image.png" />

***

## ⚙️ Edit a segment

1. Navigate to **Communications > Segments** in the left side-panel.
2. You will arrive at **Segments** page.
3. Click on the segment you would like to edit. Alternatively, you can use the kebab menu located at the end of the row containing the segment.
4. Make the necessary edits.
5. Click on the **SAVE** button.

***

## ⚙️ Use a segment

1. Navigate to **Communications > Configurations** in the left side-panel.
2. You will arrive at **Configurations** page.
3. Click on the **+ ADD COMMUNICATION** button.
4. On the **Add New Messaging** page, add the following details:
   * **Communication name**: any string that describes the message.
   * **Segment**: click on the drop-down menu to select the segment of customers.
   * **Event type**: choose between email invoice and email payment reminder.
   * **Trigger type**: choose between automatic and manual.
   * **Alert or communication type**: choose between email alert and webhook.
     * for email alert, select the [sender](https://www.zenskar.com/docs/senders) and the [attachment](https://www.zenskar.com/docs/document-templates).

<Image align="center" className="border" border={true} src="https://files.readme.io/14b38dc-image.png" />
