Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions app/api/helpers/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down Expand Up @@ -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))
)
)

Expand Down
11 changes: 7 additions & 4 deletions app/api/helpers/system_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"<br/>Please contact the organizer for more info" +
u"Your order for <a href='{event_url}'>{event_name}</a> has been cancelled by the organizer " +
u"<br/>You can visit your cancelled ticket here : <a href='{order_url}'>{invoice_id}</a> " +
u"<br/>Please contact the organizer for more info " +
u"<br/>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" <a href='{cancel_order_page}'>{event_name}</a> " +
u"<br/>Cancel Note: {cancel_note}."
)
},
Expand Down