This commit is contained in:
j3d1 2024-05-04 00:05:06 +02:00
parent 6af69aed69
commit a8a3c36fab

View file

@ -27,7 +27,6 @@ async def email_notify(message, email):
await send_smtp(mail)
class NotificationDispatcher:
channel_layer = None
room_group_name = "general"
@ -65,7 +64,8 @@ class NotificationDispatcher:
print("Error: Invalid message format")
async def dispatch(self, ticket, event_id, new):
message = render_notification_new_ticket(ticket) if new else render_notification_reply_ticket(ticket)
message = database_sync_to_async(render_notification_new_ticket)(ticket) if new else database_sync_to_async(
render_notification_reply_ticket)(ticket)
print("Dispatching message:", message, "with event_id:", event_id)
targets = await self.get_notification_targets()
await telegram_notify(message, TELEGRAM_GROUP_CHAT_ID)