feat(users): кнопка «Отправить сообщение» в карточке пользователя

Паритет с бот-кнопкой «✉️ Отправить сообщение»: в блоке действий карточки
юзера появляется кнопка (RBAC users:send_message), открывающая модалку с
текстом (HTML, лимит 4096) — бот отправляет юзеру прямое сообщение через
POST /admin/users/{id}/send-message.

Для email-only юзеров без telegram_id кнопка задизейблена с подсказкой;
коды ошибок бэкенда (no_telegram_id / forbidden / bad_request) маппятся
в честные локализованные сообщения. Локали ru/en/fa/zh.
This commit is contained in:
Case211
2026-07-14 07:28:33 +05:00
parent d7ea3c0635
commit 2f743d82db
6 changed files with 164 additions and 5 deletions

View File

@@ -3342,6 +3342,20 @@
"confirm": {
"block": "Block this user?"
},
"sendMessage": {
"button": "✉️ Send message",
"title": "Send message to user",
"placeholder": "Text the bot will send to the user (HTML supported)",
"send": "Send",
"sending": "Sending...",
"success": "Message sent to user",
"noTelegram": "This user is registered by email only and cannot receive Telegram messages",
"errors": {
"no_telegram_id": "This user is registered by email only and cannot receive Telegram messages",
"forbidden": "The user has blocked the bot or cannot receive messages",
"bad_request": "Telegram rejected the message. Check the text (HTML markup) and try again"
}
},
"userActions": {
"delete": "Delete user",
"resetTrial": "Reset trial",