# Crontinel Telegram Integration: Cron and Queue Alerts

> Deliver Crontinel Laravel alerts to Telegram via bot API or webhook relay. Good for solo founders and small teams who live in Telegram.

Source: https://crontinel.com/integrations/telegram/

Telegram is popular for fast mobile notifications. Crontinel's cloud dashboard supports Telegram as a native alert channel — it calls the Telegram Bot API directly, no relay needed. Self-hosting the OSS package requires a webhook relay to the Bot API.

## Cloud dashboard (recommended)

1. Create a bot with [@BotFather](https://t.me/BotFather), get the bot token
2. Obtain your chat ID (message the bot, then call `getUpdates` on the Bot API)
3. In [app.crontinel.com](https://app.crontinel.com), open your app's **Alert Channels**, add a **Telegram** channel, and paste the bot token and chat ID
4. Save — Crontinel calls `sendMessage` on the Telegram Bot API directly

## Self-hosted OSS package: Option A, webhook relay (recommended)

1. Create a bot with [@BotFather](https://t.me/BotFather), get the token
2. Obtain your chat ID (message the bot, then call `getUpdates` on the Bot API)
3. Deploy a tiny relay (Cloudflare Worker, Vercel function, or self-hosted script) that:
   - Accepts POST from Crontinel (`CRONTINEL_WEBHOOK_URL`)
   - Maps fields to Telegram `sendMessage`

Example Telegram API call your relay makes:

```bash
curl -s "https://api.telegram.org/bot<TOKEN>/sendMessage" \
  -d "chat_id=<CHAT_ID>" \
  -d "text=Crontinel: scheduled task invoices:sync failed (exit 1)"
```

Crontinel `.env`:

```bash
CRONTINEL_ALERT_CHANNEL=webhook
CRONTINEL_WEBHOOK_URL=https://your-relay.example.com/crontinel-to-telegram
```

## Option B: Shared automation (n8n / Make)

Use Crontinel webhook → n8n Telegram node. No custom code; good for teams already on automation platforms.

## Test

```bash
php artisan crontinel:test-alert
```

Your relay should forward one test message to Telegram.

## When Telegram fits

- Solo dev or 2-person team without Slack
- You want push notifications without installing another SaaS
- Secondary channel while primary on-call stays in PagerDuty

## Security

- Never commit bot tokens to git; use env vars on the relay
- Use a private group chat, not a public channel, for production alerts
