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

# Personalize Alert

> Personalize transactional alert content in MoEngage Inform using the personalization editor or Jinja templates with attribute fallbacks.

Alerts can be personalized in the content creation step of Alert creation using the *Text personalization* button or using JINJA.

# Personalize with the Personalization Editor

To personalize, do the following:

1. In Step 2: Content of create alert, click the **Text personalization** button. <img src="https://mintcdn.com/moengage/50ZszvUJB4M_6y_L/images/moengage_e78ee6.png?fit=max&auto=format&n=50ZszvUJB4M_6y_L&q=85&s=ac0a94f4d1251b0b1a79061478fa595b" alt="text personalize.png" width="1686" height="938" data-path="images/moengage_e78ee6.png" />
2. Add the attribute to be personalized in the **Personalisation Attribute** field on the screen that pops up.
3. You can specify user attributes as fallbacks for the personalized attribute. Note: User Attributes must be enabled in Inform Settings for this option to be available. For more information, refer to [User Attribute settings](/user-guide/settings/miscellaneous/settings-inform#user-attribute-settings). <img src="https://mintcdn.com/moengage/4hNKOAjPrnhpJB2_/images/moengage_7f5104.png?fit=max&auto=format&n=4hNKOAjPrnhpJB2_&q=85&s=5aa899baf6b9f8351b662a60e7468b4b" alt="PersonalizationEditor.png" width="992" height="828" data-path="images/moengage_7f5104.png" />
4. Click **Copy & Close** to copy the personalized attribute to the clipboard.
5. Paste the copied value in the message editor using standard keyboard shortcuts.

<Info>
  The names of the user attribute added for personalization can contain only the following: String characters, a combination of alphabets and numbers, and underscores. For example, the attribute name to be personalized can be *username* or *user\_name, or usernmae1,* while *user name* and *user name1* are not allowed. If the attribute name were to contain any character other than string characters or underscore or alphanumerics, for example, spaces, only numbers, or special characters, personalization would not work.
</Info>

<Tabs>
  <Tab title="User Attributes as fallbacks">
    The following flow diagram depicts how personalization works with User Attributes as fallbacks.

    <img src="https://mintcdn.com/moengage/xeb_76Bworf1GG6P/images/moengage_99043f.png?fit=max&auto=format&n=xeb_76Bworf1GG6P&q=85&s=3668ae7e4df747b0f46167a1c6dd0375" alt="UserAttributesas_Fallback.png" width="1178" height="1382" data-path="images/moengage_99043f.png" />

    Here is a sample message body where the user's first name and order id have been personalized with user attributes as fallbacks.

    **Sample Message Body**

    `Hi {{username|default("{{UserAttribute['USER_ATTRIBUTE_USER_NAME']|default('user')}}")}}!`

    Your order `{{orderid}}` has been placed successfully.

    Happy Shopping!

    Team MoEngage
  </Tab>

  <Tab title="Without User Attributes">
    The following flow diagram depicts how personalization works when User Attributes are disabled.

    <img src="https://mintcdn.com/moengage/dLyLAwgfsm1v6_MY/images/moengage_8565a9.png?fit=max&auto=format&n=dLyLAwgfsm1v6_MY&q=85&s=2196b7cc2d605c466d58596b1c24b84f" alt="UserAttributesas_Disabled.png" width="692" height="922" data-path="images/moengage_8565a9.png" />

    **Note:** If the user attributes are disabled (post-enabling), the standard SLA will apply to the subsequent API requests.

    Here is a sample message body where the user's first name and order id have been personalized.

    **Sample Message Body**

    Hi `{{firstname}}`!

    Your order `{{orderid}}` has been placed successfully.

    Happy Shopping!

    Team MoEngage
  </Tab>
</Tabs>

## Sample Payload with personalization

JSON

```json wrap theme={null}
{
"user_id": "john_doe",
"payloads": {
        "SMS": {
            "recipient": "+1555555555",
            "personalized_attributes": {
                "firstname": "John",
                "orderid": "#order HXY-12345-ZSDF"
            }
        },
        "EMAIL": {
            "recipient": "john.doe@moengage.com",
            "personalized_attributes": {
                "firstname": "John",
                "orderid": "#order HXY-12345-ZSDF"
            }
        }
    }
```

The firstname and orderid need to be sent when the request is triggered.

## Personalized Alert as received by the customer

<Tabs>
  <Tab title="Alert SMS Received by User">
    <img src="https://mintcdn.com/moengage/eF2J43N9Ckga5Apm/images/moengage_2d42e0.png?fit=max&auto=format&n=eF2J43N9Ckga5Apm&q=85&s=e5140849055c42c482e288a46da91725" alt="AlertSMS.jpg" width="1165" height="877" data-path="images/moengage_2d42e0.png" />
  </Tab>

  <Tab title="Alert Email Received by User">
    <img src="https://mintcdn.com/moengage/OQ0V9ibjQLpsyCSD/images/moengage_0f97c9.png?fit=max&auto=format&n=OQ0V9ibjQLpsyCSD&q=85&s=3f6024a4b32fc22f28c5a9d5932d9e29" alt="AlertEmail.png" width="2880" height="680" data-path="images/moengage_0f97c9.png" />
  </Tab>

  <Tab title="Alert Push Notification Received by User">
    <img src="https://mintcdn.com/moengage/xjBZUVmmH3jDrySH/images/moengage_c62675.png?fit=max&auto=format&n=xjBZUVmmH3jDrySH&q=85&s=c6acfd25c53ae7e09c2a8407d6b01fc3" alt="Personalized_Notification__1_.png" width="1073" height="481" data-path="images/moengage_c62675.png" />
  </Tab>
</Tabs>

# Personalization Using Content Blocks

Content Blocks are reusable content that can be used in alerts. Personalizing alerts by leveraging the *Content Blocks* feature enhances user engagement, efficiency, and the overall customer experience. For more information on creating content blocks for alerts, refer to [Content Blocks](/user-guide/content/content-blocks/content-blocks).

## Adding a Content Block

1. To add a content block, click the **Text personalization** button. The Inform personalization pop-up window is displayed. <img src="https://mintcdn.com/moengage/geRh9DNA2GhPhrjA/images/moengage_f4feab.png?fit=max&auto=format&n=geRh9DNA2GhPhrjA&q=85&s=d4123053a4d15da1dd647e6112f5ecf5" alt="21.png" width="850" height="694" data-path="images/moengage_f4feab.png" />
2. Navigate to the **Content block** tab.
3. Select the desired content block from the **Select content block** drop-down. <img src="https://mintcdn.com/moengage/cFTwc93vQdTanvKi/images/moengage_be7257.png?fit=max&auto=format&n=cFTwc93vQdTanvKi&q=85&s=d81f91b85041ed837ea156cc56f47e25" alt="22.png" width="850" height="698" data-path="images/moengage_be7257.png" />
4. You can also insert only the content of the content block using the following toggle. <img src="https://mintcdn.com/moengage/t9nft78wsoLTI2Nx/images/moengage_293f39.png?fit=max&auto=format&n=t9nft78wsoLTI2Nx&q=85&s=8372e43287725e885f4d38c88485b197" alt="23.png" width="492" height="66" data-path="images/moengage_293f39.png" /> This means that only the content will be inserted while detaching itself from the existing content block and any future updates will not be reflected.
5. Click **Copy & Close** to copy the personalized attribute to the clipboard.
6. Paste the copied value in the message editor using standard keyboard shortcuts.

# Personalize using JINJA

To personalize an alert using JINJA, add the JINJA to the template editor in the content creation step and pass the attributes used in the JINJA in the \_personalized\_attributes\_object in your request payload.

## Sample Payload with personalization

Sample Email Payload

```json theme={null}
{  
    "alert_id": "652fba0290f2820d05e12852",
    "user_id": "John_Doe",
    "transaction_id": "135671868",
    "payloads": {
        "EMAIL": {
            "recipient": "john.doe@example.com",
            "personalized_attributes": {
                "items": [
                  {  
                    "name": "iPhone 15",
                    "price": "2500 AED",
                    "image": "https://yourbrand.com/iPhone.jpg"
                  },
                  {
                    "name": "Macbook Air",
                    "price": "3000 AED",
                    "image": "https://yourbrand.com/MacbookAir.jpg"
                  },
                  {
                    "name": "Airpods",
                    "price": "800 AED",
                    "image": "https://yourbrand.com/Airpods.jpg"
                  }
                ],
           }
        }
    }
}
```

## Personalized Alert Received by the customer

<img src="https://mintcdn.com/moengage/0iWkm50wROjmHH3Z/images/moengage_d09832.png?fit=max&auto=format&n=0iWkm50wROjmHH3Z&q=85&s=3724442eae216c2a6568eab4665a4f49" alt="JINJAPersonalization_Email.png" width="2218" height="1328" data-path="images/moengage_d09832.png" />
