worker: Telegram notice about every purchase (notify task)
CI / test (push) Successful in 1m49s
CI / build (push) Successful in 8m27s
CI / deploy (push) Skipped

A separate worker task, apart from invoicing: each paid checkout is
announced once to the operator's Telegram chat ('Páros csomag, 6 000 Ft',
marked when it was a test payment), without the buyer's data. Outages
and rate limits are retried; a wrong token or chat is logged, not
retried. Needs TELEGRAM_BOT_TOKEN (.env.secrets) and TELEGRAM_CHAT_ID.

Also fixes the worker test that still expected the old sign-up e-mail
subject (CI failed on it since 7d6a6c3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-21 19:04:20 +00:00
co-authored by Claude Opus 5.5
parent 55048ed828
commit a571abdb65
10 changed files with 294 additions and 7 deletions
+3 -1
View File
@@ -129,7 +129,9 @@ services:
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-worker:${TAG:-latest}
environment:
DATABASE_URL: postgres://sorsfonalak:${POSTGRES_PASSWORD}@postgres:5432/sorsfonalak
WORKER_TASKS: email,cleanup,invoices
WORKER_TASKS: email,cleanup,invoices,notify
# Purchase notices to Telegram; the bot token (TELEGRAM_BOT_TOKEN) is in .env.secrets.
TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:-}
# SMTP_URL or the SES credentials come from .env.secrets (docs/levelkuldes.md);
# listing them here with an empty default would override that file.
SES_REGION: ${SES_REGION:-eu-central-1}