Saltar al contenido principal

Send notifications to Telegram

This guide explains how to send the notifications of Casdoor to a Telegram chat through a bot.


Learning outcomes​

  • Create a Telegram bot and find the chat ID.
  • Add Telegram as a notification provider in Casdoor.

What you need​

  • A Telegram account
  • Administrator access to the Casdoor admin console

Create a bot​

  1. Open @BotFather and send /newbot.

  2. Enter the name and the username of the bot. BotFather replies with the API token.

    API token from BotFather

Find the chat ID​

Start a chat with @RawDataBot. It shows your chat ID.

Chat ID from RawDataBot

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to Notification and Type to Telegram.

  3. Fill in the fields:

    Casdoor fieldValue
    Secret keyAPI Token
    Chat IDID de chat
    ContentMessage template (optional)

    Telegram notification provider in Casdoor

  4. Click Send Testing Notification, and save the provider.

See also​