44
55from lnbits .core .models .users import UserNotifications
66from lnbits .core .services .nostr import send_nostr_dm
7- from lnbits .core .services .notifications import send_user_notification
7+ from lnbits .core .services .notifications import (
8+ send_email_notification ,
9+ send_user_notification ,
10+ )
811from lnbits .settings import settings
912from lnbits .utils .nostr import normalize_private_key , normalize_public_key
1013from lnurl import execute
@@ -53,11 +56,15 @@ async def _send_ticket_notification(ticket: Ticket) -> None:
5356 return
5457
5558 ticket_url = _ticket_url (ticket )
56- message = (
57- f"{ settings .lnbits_site_title } \n "
58- f"Your ticket for '{ event .name } ' is ready.\n "
59- f"Open it here: { ticket_url } "
59+ subject = (
60+ event .extra .notification_subject .strip ()
61+ or f"Your ticket for '{ event .name } ' is ready"
62+ )
63+ body = (
64+ event .extra .notification_body .strip ()
65+ or f"Your ticket for '{ event .name } ' is ready."
6066 )
67+ message = f"{ body } \n \n Open it here: { ticket_url } "
6168 updated = False
6269
6370 if (
@@ -66,11 +73,7 @@ async def _send_ticket_notification(ticket: Ticket) -> None:
6673 and ticket .email
6774 ):
6875 try :
69- await send_user_notification (
70- UserNotifications (email_address = ticket .email ),
71- message ,
72- "text_message" ,
73- )
76+ await send_email_notification ([ticket .email ], message , subject )
7477 ticket .extra .email_notification_sent = True
7578 updated = True
7679 except Exception as exc :
0 commit comments