feat: Send notification when booking is impossible
This commit is contained in:
@@ -114,6 +114,24 @@ class SessionNotifier:
|
||||
email_message = f"Session available soon: {session_details} (in {days_until} days)"
|
||||
telegram_message = f"Session available soon: {session_details} (in {days_until} days)"
|
||||
|
||||
# Send notifications through enabled channels
|
||||
if self.enable_email:
|
||||
self.send_email_notification(email_message)
|
||||
|
||||
if self.enable_telegram:
|
||||
await self.send_telegram_notification(telegram_message)
|
||||
|
||||
async def notify_impossible_booking(self, session_details):
|
||||
"""
|
||||
Notify about an impossible session booking via email and Telegram.
|
||||
|
||||
Args:
|
||||
session_details (str): Details about the session that couldn't be booked
|
||||
"""
|
||||
# Create messages for both email and Telegram
|
||||
email_message = f"Failed to book session: {session_details}"
|
||||
telegram_message = f"Failed to book session: {session_details}"
|
||||
|
||||
# Send notifications through enabled channels
|
||||
if self.enable_email:
|
||||
self.send_email_notification(email_message)
|
||||
|
||||
Reference in New Issue
Block a user