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

# In-App Template

## 📜 Template

You can create the template while creating an Event with In-App channel enabled.
You can easily create/update the template content by editing the event.

<div className="flex flex-row w-full items-center justify-center space-x-4 h-64">
  <img className="h-auto w-[256px]" src="https://mintcdn.com/raven/kmn_wV2dGv3NIOgZ/images/notification-ui.png?fit=max&auto=format&n=kmn_wV2dGv3NIOgZ&q=85&s=d5edca6eaa4efa5e431ed3b24585e9ef" width="691" height="447" data-path="images/notification-ui.png" />

  <img className="h-auto w-[256px]" src="https://mintcdn.com/raven/kmn_wV2dGv3NIOgZ/images/template.png?fit=max&auto=format&n=kmn_wV2dGv3NIOgZ&q=85&s=89526e1f4a65c27a0886976b73022cc3" width="2828" height="1352" data-path="images/template.png" />
</div>

### Template Components

1. **Title**: Title of the notification
2. **Body**: Notification subtitle
3. **Click Action**: Unique string that will be passed to the click handler in
   the SDK. Use this string to handle what action to perform once the
   notification is clicked. E.g. OPEN\_ORDER\_PAGE opens the order page.
4. **Custom Data**: Key value map that will be passed to your notification. You
   can use this to pass any additional data with the notification, like orderid,
   username etc.

### Dynamic Content

To pass dynamic or custom data in the template like invoice number, user name,
tracking link etc., you should wrap it within handlebars `{{ user_name }}` . Raven
uses [Handlebars.js](https://handlebarsjs.com/guide/#what-is-handlebars) to
parse the template and all handlebar operations are supported. Following
Handlebars expressions are supported within templates:

1. Nested objects
2. \#if, #each, #with

You will need to pass the value of the variables in the data object of
[Send Event API](/api-reference/send-event).

**Example**

```javascript theme={null}
In-App Template:
Hey {{user_name}}, Thank you for your Order Id# {{order.id}} of amount {{order.amount}}.
{{#if premium}} Glad to have you as our Premium customer. {{/if}}
```

`data` object in API:

```json theme={null}
...,
"data": {
    "user_name": "Joe",
    "order": {
        "id": 123,
        "amount": 745
    },
    "premium": true
}
```
