# Telegram notifications

Bitcart makes use of the [Apprise](https://github.com/caronc/apprise) API to deliver notifications to Telegram.

![](/files/5pcEUcphYZq09RwORNVr)

To integrate Telegram with Bitcart, you by-and-large follow the procedure outlined in the [Setup Guide](https://appriseit.com/services/telegram). However, there are few recommendations and gotchas.

## Multiple recipients

You can deliver the notifications to multiple telegram users by providing multiple chat ids, separated by spaces.

## Markdown templates

Due to a [bug](https://github.com/caronc/apprise/issues/1178#issuecomment-2269802339), if you select `markdown` as the template format, you should leave the `markdown version` field blank, or set it to `1`. Contrary to the apprise documentation, specifying `2` or `v2` here will result in messages not being delivered.

Telegram only supports a subset of markdown. It pays to read the [Telegram docs](https://core.telegram.org/api/entities#allowed-entities) to see what's supported.

If there are any mistakes, the message gets rendered as text (at best), or (usually) apprise rejects the notification with a "bad parse" error. This is true of user input too. If promo code is `FREE_STUFF`, the underscore is interpreted as the start of italics and will break all the formatting.

For this reason, you *must* escape all input in your templates, especially user-provided input like email addresses, notes, and shipping addresses. Bitcart provides a ready filter for markdown v1, e.g. `{{ invoice.buyer_email|tg_escape }}`.

But if you're doing anything but the simplest of reports, it's *highly* recommended to just switch HTML templates over Markdown.

## HTML templates

For more complicated notifications, prefer HTML templates. Again, Telegram has limited support for HTML, but the Jinja templating engine has better support for escaping HTML entities.

See [the HTML notification template example](/examples/templates.md#html-notification-template) for a working example.


---

# 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.bitcart.ai/guides/telegram-notifications.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.
