From f22b484f0f2326d0c68f4d7ce1cf716e800c0a47 Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Fri, 21 Jun 2019 21:51:52 +0530 Subject: [PATCH] modify message and add proper links --- app/api/helpers/notification.py | 14 +++++++++++--- app/api/helpers/system_notifications.py | 11 +++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/api/helpers/notification.py b/app/api/helpers/notification.py index e4350f24f4..ba6d80849e 100644 --- a/app/api/helpers/notification.py +++ b/app/api/helpers/notification.py @@ -2,6 +2,7 @@ from app.api.helpers.db import save_to_db from app.api.helpers.log import record_activity +from app.api.helpers.files import make_frontend_url from app.api.helpers.system_notifications import NOTIFS, get_event_exported_actions, get_event_imported_actions, \ get_monthly_payment_notification_actions, get_monthly_payment_follow_up_notification_actions, \ get_ticket_purchased_attendee_notification_actions, get_ticket_purchased_notification_actions, \ @@ -279,18 +280,25 @@ def send_notif_ticket_cancel(order): ), message=NOTIFS[TICKET_CANCELLED]['message'].format( cancel_note=order.cancel_note, - event_name=order.event.name + event_name=order.event.name, + event_url=make_frontend_url('/e/{identifier}'.format(identifier=order.event.identifier)), + order_url=make_frontend_url('/orders/{identifier}/view'.format(identifier=order.identifier)), + invoice_id=order.invoice_number ) ) for organizer in order.event.organizers: send_notification( user=organizer, title=NOTIFS[TICKET_CANCELLED_ORGANIZER]['title'].format( - invoice_id=order.invoice_number + invoice_id=order.invoice_number, + event_name=order.event.name ), message=NOTIFS[TICKET_CANCELLED_ORGANIZER]['message'].format( cancel_note=order.cancel_note, - invoice_id=order.invoice_number + invoice_id=order.invoice_number, + event_name=order.event.name, + cancel_order_page=make_frontend_url('/events/{identifier}/tickets/orders/cancelled' + .format(identifier=order.event.identifier)) ) ) diff --git a/app/api/helpers/system_notifications.py b/app/api/helpers/system_notifications.py index c1647524d6..5ecdcc41bc 100644 --- a/app/api/helpers/system_notifications.py +++ b/app/api/helpers/system_notifications.py @@ -350,16 +350,19 @@ def get_invite_papers_notification_actions(cfs_link, submit_link): 'recipient': 'User', 'title': u'Your order for {event_name} has been cancelled ({invoice_id})', 'message': ( - u"Your order for {event_name} has been cancelled by the organizer" + - u"
Please contact the organizer for more info" + + u"Your order for {event_name} has been cancelled by the organizer " + + u"
You can visit your cancelled ticket here : {invoice_id} " + + u"
Please contact the organizer for more info " + u"
Message from the organizer: {cancel_note}." ) }, TICKET_CANCELLED_ORGANIZER: { 'recipient': 'User', - 'title': u'Order ({invoice_id}) has been cancelled', + 'title': u'Order ({invoice_id}) of {event_name} has been cancelled', 'message': ( - u"Order ({invoice_id}) has been cancelled" + + u"Order ({invoice_id}) has been cancelled " + + u"Please visit the link to check the cancelled orders for this event:" + + u" {event_name} " + u"
Cancel Note: {cancel_note}." ) },