This commit is contained in:
@@ -191,6 +191,8 @@ async def create_service_notification(
|
||||
appointment_id: int | None = None,
|
||||
send_telegram: bool = True,
|
||||
idempotency_key: str | None = None,
|
||||
web_app_url: str | None = None,
|
||||
button_text: str = "Открыть",
|
||||
) -> ServiceNotification:
|
||||
if idempotency_key:
|
||||
existing = (
|
||||
@@ -214,7 +216,8 @@ async def create_service_notification(
|
||||
user = await session.get(User, recipient_user_id)
|
||||
if user is not None:
|
||||
notification.status = "processing"
|
||||
delivered = await notify_user(user, f"{title}\n{body}" if body else title)
|
||||
message = f"{title}\n{body}" if body else title
|
||||
delivered = await notify_user(user, message, web_app_url=web_app_url, button_text=button_text)
|
||||
if delivered:
|
||||
notification.status = "sent"
|
||||
notification.sent_at = datetime.now(UTC)
|
||||
|
||||
Reference in New Issue
Block a user