Skip to content

Commit

Permalink
Update REadme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Mithun Shivashankar committed Oct 16, 2024
1 parent 26f949a commit 105baab
Showing 1 changed file with 87 additions and 1 deletion.
88 changes: 87 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,90 @@ Here are some common format strings you can use with the `datetimeformat` filter
- `%A, %d %B %Y` - Outputs as `Monday, 17 June 2024`
- `%I:%M %p` - Outputs as `02:45 PM`
- `%B %d, %Y` - Outputs as `June 17, 2024`
- `%Y-%m-%d` - Outputs as `2024-06-17`
- `%Y-%m-%d` - Outputs as `2024-06-17`


### 🚀 5. Sending Notifications to Kafka

**Overview**

ASAB Iris supports sending notifications to various communication channels such as email, Slack, and Microsoft Teams via Kafka. Each notification is structured using templates and parameters to ensure customizable content.

#### Kafka Message Structure

- Notifications are sent to Kafka in JSON format.
- Each notification contains a `type` field specifying the channel (e.g., `email`, `slack`, `msteams`), and a `body` that includes the template and its parameters.

#### 1. Sending Email Notifications

**Example Kafka Message:**

```json
{
"type": "email",
"to": ["Shivashankar <mithunshivashankar@gmail.com>"],
"from": "info@teskalabs.com",
"body": {
"template": "/Templates/Email/message.md",
"params": {
"name": "I am testing a template",
"error": "None"
}
}
}
```

**Explanation:**

- `type`: Defines the notification type as `email`.
- `to`: List of recipients.
- `from`: The sender's email address.
- `template`: Path to the template used for the email content.
- `params`: Parameters for populating the email template.

#### 2. Sending Slack Notifications

**Example Kafka Message:**

```json
{
"type": "slack",
"body": {
"template": "/Templates/Slack/Slack example.md",
"params": {
"name": "I am testing a template",
"error": "None"
}
}
}
```

**Explanation:**

- `type`: Defines the notification type as `slack`.
- `body.template`: Path to the Slack message template.
- `params`: Parameters for populating the Slack template.

#### 3. Sending Microsoft Teams Notifications

**Example Kafka Message:**

```json
{
"type": "msteams",
"body": {
"template": "/Templates/MSTeams/Teams example.md",
"params": {
"name": "I am testing a template",
"error": "None"
}
}
}
```

**Explanation:**

- `type`: Defines the notification type as `msteams`.
- `body.template`: Path to the Microsoft Teams message template.
- `params`: Parameters for populating the Teams template.
```

0 comments on commit 105baab

Please sign in to comment.