We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
On updating an order server returns internal server error for sending notifications
**Describe the bug**
Server returns internal server error when an order is updated. This error is thrown is sending notifications part.

**Expected behavior**
Error should not be thrown and notifications should be sent.

**Stacktrace**
```


INFO:werkzeug:127.0.0.1 - - [12/Jul/2018 02:55:37] "PATCH /v1/orders/4 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/rs/Pradeep/github/open-event-server/app/__init__.py", line 66, in __call__
    return self.app(environ, start_response)
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/rs/Pradeep/github/open-event-server/app/api/helpers/permissions.py", line 45, in decorator
    return fn(*args, **kwargs)
  File "/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/decorators.py", line 32, in wrapper
    return func(*args, **kwargs)
  File "/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/views.py", line 88, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/resource.py", line 68, in dispatch_request
    response = method(*args, **kwargs)
  File "/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/decorators.py", line 56, in wrapper
    return func(*args, **kwargs)
  File "/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/resource.py", line 307, in patch
    self._data_layer.update_object(obj, data, kwargs)
  File "/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/data_layers/alchemy.py", line 144, in update_object
    self.after_update_object(obj, data, view_kwargs)
  File "/home/rs/Pradeep/github/open-event-server/app/api/orders.py", line 278, in after_update_object
    send_notif_ticket_cancel(order)
  File "/home/rs/Pradeep/github/open-event-server/app/api/helpers/notification.py", line 210, in send_notif_ticket_cancel
    title=NOTIFS[TICKET_CANCELLED]['title'].format(
KeyError: 'title'
```

**Additional details (please complete the following information):**
 - OS: [e.g. MacOS, Ubuntu, CentOS]
 - Python Version [e.g. `3.5`, `3.6`]
 - `HEAD` Commit hash [e.g. `4629c62`]

**Additional context**
<!-- Add any other context about the problem here. -->


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `app/api/helpers/system_notifications.py`
Content:
```
1 """
2 User Notification Structures
3 """
4 from app.models.notification import (
5     EVENT_ROLE,
6     NEW_SESSION,
7     SESSION_SCHEDULE,
8     NEXT_EVENT,
9     SESSION_ACCEPT_REJECT,
10     INVITE_PAPERS,
11     AFTER_EVENT,
12     EVENT_PUBLISH,
13     USER_CHANGE_EMAIL,
14     PASSWORD_CHANGE,
15     TICKET_PURCHASED,
16     TICKET_RESEND_ORGANIZER,
17     EVENT_EXPORT_FAIL,
18     EVENT_EXPORTED,
19     EVENT_IMPORT_FAIL,
20     EVENT_IMPORTED,
21     MONTHLY_PAYMENT_NOTIF,
22     MONTHLY_PAYMENT_FOLLOWUP_NOTIF,
23     TICKET_PURCHASED_ORGANIZER,
24     TICKET_PURCHASED_ATTENDEE,
25     TICKET_CANCELLED,
26     TICKET_CANCELLED_ORGANIZER
27 )
28 
29 NOTIFS = {
30     EVENT_EXPORTED: {
31         'recipient': 'User',
32         'title': u'Event {event_name} has been exported',
33         'message': (
34             u"Event <strong>{event_name}</strong> has been exported successfully."
35             u"<br><br><a href='{download_url}' class='btn btn-info btn-sm'>Download</a>"
36         )
37     },
38     EVENT_EXPORT_FAIL: {
39         'recipient': 'User',
40         'title': u'Export of event {event_name} failed',
41         'message': (
42             u"The following error occurred:<br>"
43             u"<pre>{error_text}</pre>"
44         )
45     },
46     EVENT_IMPORTED: {
47         'recipient': 'User',
48         'title': u'Event {event_name} has been imported',
49         'message': (
50             u"Event <strong>{event_name}</strong> has been imported successfully."
51             u"<br><br><a href='{event_url}' class='btn btn-info btn-sm'>View Event</a>"
52         )
53     },
54     EVENT_IMPORT_FAIL: {
55         'recipient': 'User',
56         'title': u'Import of event failed',
57         'message': (
58             u"The following error occurred:<br>"
59             u"<pre>{error_text}</pre>"
60         )
61     },
62     MONTHLY_PAYMENT_NOTIF: {
63         'recipient': 'Organizer',
64         'subject': u'{date} - Monthly service fee invoice for {event_name}',
65         'message': (
66             u"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}." +
67             u"<br/> That payment for the same has to be made in two weeks. <a href='{payment_url}'>Click here</a> to "
68             u"view your invoice and complete the payment."
69             u"<br><br><em>Thank you for using {app_name}.</em>"
70         ),
71         'sent_at': '1st day of the month'
72     },
73     MONTHLY_PAYMENT_FOLLOWUP_NOTIF: {
74         'recipient': 'Organizer',
75         'subject': u'Past Due: {date} - Monthly service fee invoice for {event_name}',
76         'message': (
77             u"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}." +
78             u"<br/> That payment for the same is past the due date. <a href='{payment_url}'>Click here</a> to "
79             u"view your invoice and complete the payment to prevent loss of functionality."
80             u"<br><br><em>Thank you for using {app_name}.</em>"
81         ),
82         'sent_at': '15th day of the month'
83     },
84     TICKET_PURCHASED: {
85         'recipient': 'User',
86         'title': u'Your order invoice and tickets ({invoice_id})',
87         'message': (
88             u"Your order has been processed successfully."
89             u"<br><br><a href='{order_url}' class='btn btn-info btn-sm'>View Invoice</a>"
90         )
91     },
92     TICKET_PURCHASED_ATTENDEE: {
93         'recipient': 'User',
94         'title': u'Your ticket for {event_name}',
95         'message': (
96             u"Your order has been processed successfully."
97             u"<br><br><a href='{pdf_url}' class='btn btn-info btn-sm'>View PDF</a>"
98         )
99     },
100     TICKET_PURCHASED_ORGANIZER: {
101         'recipient': 'Organizer',
102         'title': u'New ticket purchase for {event_name} : ({invoice_id}) ',
103         'message': (
104             u"The order has been processed successfully."
105             u"<br><br><a href='{order_url}' class='btn btn-info btn-sm'>View Invoice</a>"
106         )
107     },
108     TICKET_RESEND_ORGANIZER: {
109         'recipient': 'Organizer',
110         'title': u'Email resent for {event_name} by {buyer_email} ({invoice_id}) ',
111         'message': (
112             u"Email has been sent successfully."
113         )
114     },
115     TICKET_CANCELLED: {
116         'recipient': 'User',
117         'subject': u'Your order for {event_name} has been cancelled ({invoice_id})',
118         'message': (
119             u"Your order for {event_name} has been cancelled by the organizer"
120             u"<br/>Please contact the organizer for more info" +
121             u"<br/>Message from the organizer: {cancel_note}."
122         )
123     },
124     TICKET_CANCELLED_ORGANIZER: {
125         'recipient': 'User',
126         'subject': u'Order ({invoice_id}) has been cancelled',
127         'message': (
128             u"Order ({invoice_id}) has been cancelled"
129             u"<br/>Cancel Note: {cancel_note}."
130         )
131     },
132     USER_CHANGE_EMAIL: {
133         'recipient': 'User',
134         'title': u'Your email has been changed',
135         'message': (
136             u"Your email has been changed from {email} to {new_email}.<br>Please verify your new email."
137         )
138     },
139     PASSWORD_CHANGE: {
140         'recipient': 'User',
141         'subject': u'{app_name}: Password Change',
142         'message': (
143             u"Your password has been successfully changed."
144         )
145     },
146     AFTER_EVENT: {
147         'title': u'Event {event_name} completed',
148         'message': u"""The event <strong>{event_name}</strong> has been completed.<br><br>""",
149         'recipient': 'User',
150     },
151     EVENT_PUBLISH: {
152         'title': u'Event {event_name} has been published',
153         'message': u"""The event <strong>{event_name}</strong> has been published.<br><br>
154                    <a href='{link}' class='btn btn-info btn-sm'>View Event</a>""",
155         'recipient': 'User',
156     },
157     EVENT_ROLE: {
158         'title': u'Invitation to be {role_name} at {event_name}',
159         'message': u"""You've been invited to be a <strong>{role_name}</strong>
160             at <strong>{event_name}</strong>.<br><br>
161             To accept the role please sign up using the following link: <a href='{link}' target='_blank'>Link</a>.""",
162         'recipient': 'User',
163     },
164     NEW_SESSION: {
165         'title': u'New session proposal for {event_name}',
166         'message': u"""The event <strong>{event_name}</strong> has received
167              a new session proposal.<br><br>
168             <a href='{link}' class='btn btn-info btn-sm'>View Session</a>""",
169         'recipient': 'Organizer',
170     },
171     SESSION_SCHEDULE: {
172         'title': u'Schedule for Session {session_name} has been changed',
173         'message': u"""The schedule for session <strong>{session_name}</strong>
174              has been changed.<br><br>
175             <a href='{link}' class='btn btn-info btn-sm'>View Session</a>""",
176         'recipient': 'Organizer, Speaker',
177     },
178     NEXT_EVENT: {
179         'title': u'Event {event_name} is coming soon',
180         'message': u"""Here are upcoming events: {up_coming_events}.<br><br>
181             <a href='{link}' class='btn btn-info btn-sm'>View Event</a>""",
182         'recipient': 'Organizer, Speaker',
183     },
184     SESSION_ACCEPT_REJECT: {
185         'title': u'Session {session_name} has been {acceptance}',
186         'message': u"""The session <strong>{session_name}</strong> has been
187              <strong>{acceptance}</strong> by the Organizer.<br><br>
188             <a href='{link}' class='btn btn-info btn-sm'>View Session</a>""",
189         'recipient': 'Speaker',
190     },
191     INVITE_PAPERS: {
192         'title': u'Invitation to Submit Papers for {event_name}',
193         'message': u"""You have been invited to submit papers for <strong>{event_name}</strong>.<br><br>
194             <a href='{cfs_link}' class='btn btn-info btn-sm'>View Call for Speakers</a>
195             <a href='{submit_link}' class='btn btn-success btn-sm'>Submit</a>""",
196         'recipient': 'Speaker',
197     },
198 }
199
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/app/api/helpers/system_notifications.py b/app/api/helpers/system_notifications.py
--- a/app/api/helpers/system_notifications.py
+++ b/app/api/helpers/system_notifications.py
@@ -114,7 +114,7 @@
     },
     TICKET_CANCELLED: {
         'recipient': 'User',
-        'subject': u'Your order for {event_name} has been cancelled ({invoice_id})',
+        '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" +
@@ -123,7 +123,7 @@
     },
     TICKET_CANCELLED_ORGANIZER: {
         'recipient': 'User',
-        'subject': u'Order ({invoice_id}) has been cancelled',
+        'title': u'Order ({invoice_id}) has been cancelled',
         'message': (
             u"Order ({invoice_id}) has been cancelled"
             u"<br/>Cancel Note: {cancel_note}."

{"golden_diff": "diff --git a/app/api/helpers/system_notifications.py b/app/api/helpers/system_notifications.py\n--- a/app/api/helpers/system_notifications.py\n+++ b/app/api/helpers/system_notifications.py\n@@ -114,7 +114,7 @@\n     },\n     TICKET_CANCELLED: {\n         'recipient': 'User',\n-        'subject': u'Your order for {event_name} has been cancelled ({invoice_id})',\n+        'title': u'Your order for {event_name} has been cancelled ({invoice_id})',\n         'message': (\n             u\"Your order for {event_name} has been cancelled by the organizer\"\n             u\"<br/>Please contact the organizer for more info\" +\n@@ -123,7 +123,7 @@\n     },\n     TICKET_CANCELLED_ORGANIZER: {\n         'recipient': 'User',\n-        'subject': u'Order ({invoice_id}) has been cancelled',\n+        'title': u'Order ({invoice_id}) has been cancelled',\n         'message': (\n             u\"Order ({invoice_id}) has been cancelled\"\n             u\"<br/>Cancel Note: {cancel_note}.\"\n", "issue": "On updating an order server returns internal server error for sending notifications\n**Describe the bug**\r\nServer returns internal server error when an order is updated. This error is thrown is sending notifications part.\r\n\r\n**Expected behavior**\r\nError should not be thrown and notifications should be sent.\r\n\r\n**Stacktrace**\r\n```\r\n\r\n\r\nINFO:werkzeug:127.0.0.1 - - [12/Jul/2018 02:55:37] \"PATCH /v1/orders/4 HTTP/1.1\" 500 -\r\nTraceback (most recent call last):\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 2309, in __call__\r\n    return self.wsgi_app(environ, start_response)\r\n  File \"/home/rs/Pradeep/github/open-event-server/app/__init__.py\", line 66, in __call__\r\n    return self.app(environ, start_response)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 2295, in wsgi_app\r\n    response = self.handle_exception(e)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py\", line 161, in wrapped_function\r\n    return cors_after_request(app.make_response(f(*args, **kwargs)))\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py\", line 161, in wrapped_function\r\n    return cors_after_request(app.make_response(f(*args, **kwargs)))\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 1741, in handle_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/_compat.py\", line 35, in reraise\r\n    raise value\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 2292, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 1815, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py\", line 161, in wrapped_function\r\n    return cors_after_request(app.make_response(f(*args, **kwargs)))\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask_cors/extension.py\", line 161, in wrapped_function\r\n    return cors_after_request(app.make_response(f(*args, **kwargs)))\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 1718, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/_compat.py\", line 35, in reraise\r\n    raise value\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 1813, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/app.py\", line 1799, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/home/rs/Pradeep/github/open-event-server/app/api/helpers/permissions.py\", line 45, in decorator\r\n    return fn(*args, **kwargs)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/decorators.py\", line 32, in wrapper\r\n    return func(*args, **kwargs)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/lib/python3.5/site-packages/flask/views.py\", line 88, in view\r\n    return self.dispatch_request(*args, **kwargs)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/resource.py\", line 68, in dispatch_request\r\n    response = method(*args, **kwargs)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/decorators.py\", line 56, in wrapper\r\n    return func(*args, **kwargs)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/resource.py\", line 307, in patch\r\n    self._data_layer.update_object(obj, data, kwargs)\r\n  File \"/home/rs/Pradeep/github/open-event-server/env/src/flask-rest-jsonapi/flask_rest_jsonapi/data_layers/alchemy.py\", line 144, in update_object\r\n    self.after_update_object(obj, data, view_kwargs)\r\n  File \"/home/rs/Pradeep/github/open-event-server/app/api/orders.py\", line 278, in after_update_object\r\n    send_notif_ticket_cancel(order)\r\n  File \"/home/rs/Pradeep/github/open-event-server/app/api/helpers/notification.py\", line 210, in send_notif_ticket_cancel\r\n    title=NOTIFS[TICKET_CANCELLED]['title'].format(\r\nKeyError: 'title'\r\n```\r\n\r\n**Additional details (please complete the following information):**\r\n - OS: [e.g. MacOS, Ubuntu, CentOS]\r\n - Python Version [e.g. `3.5`, `3.6`]\r\n - `HEAD` Commit hash [e.g. `4629c62`]\r\n\r\n**Additional context**\r\n<!-- Add any other context about the problem here. -->\r\n\n", "before_files": [{"content": "\"\"\"\nUser Notification Structures\n\"\"\"\nfrom app.models.notification import (\n    EVENT_ROLE,\n    NEW_SESSION,\n    SESSION_SCHEDULE,\n    NEXT_EVENT,\n    SESSION_ACCEPT_REJECT,\n    INVITE_PAPERS,\n    AFTER_EVENT,\n    EVENT_PUBLISH,\n    USER_CHANGE_EMAIL,\n    PASSWORD_CHANGE,\n    TICKET_PURCHASED,\n    TICKET_RESEND_ORGANIZER,\n    EVENT_EXPORT_FAIL,\n    EVENT_EXPORTED,\n    EVENT_IMPORT_FAIL,\n    EVENT_IMPORTED,\n    MONTHLY_PAYMENT_NOTIF,\n    MONTHLY_PAYMENT_FOLLOWUP_NOTIF,\n    TICKET_PURCHASED_ORGANIZER,\n    TICKET_PURCHASED_ATTENDEE,\n    TICKET_CANCELLED,\n    TICKET_CANCELLED_ORGANIZER\n)\n\nNOTIFS = {\n    EVENT_EXPORTED: {\n        'recipient': 'User',\n        'title': u'Event {event_name} has been exported',\n        'message': (\n            u\"Event <strong>{event_name}</strong> has been exported successfully.\"\n            u\"<br><br><a href='{download_url}' class='btn btn-info btn-sm'>Download</a>\"\n        )\n    },\n    EVENT_EXPORT_FAIL: {\n        'recipient': 'User',\n        'title': u'Export of event {event_name} failed',\n        'message': (\n            u\"The following error occurred:<br>\"\n            u\"<pre>{error_text}</pre>\"\n        )\n    },\n    EVENT_IMPORTED: {\n        'recipient': 'User',\n        'title': u'Event {event_name} has been imported',\n        'message': (\n            u\"Event <strong>{event_name}</strong> has been imported successfully.\"\n            u\"<br><br><a href='{event_url}' class='btn btn-info btn-sm'>View Event</a>\"\n        )\n    },\n    EVENT_IMPORT_FAIL: {\n        'recipient': 'User',\n        'title': u'Import of event failed',\n        'message': (\n            u\"The following error occurred:<br>\"\n            u\"<pre>{error_text}</pre>\"\n        )\n    },\n    MONTHLY_PAYMENT_NOTIF: {\n        'recipient': 'Organizer',\n        'subject': u'{date} - Monthly service fee invoice for {event_name}',\n        'message': (\n            u\"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}.\" +\n            u\"<br/> That payment for the same has to be made in two weeks. <a href='{payment_url}'>Click here</a> to \"\n            u\"view your invoice and complete the payment.\"\n            u\"<br><br><em>Thank you for using {app_name}.</em>\"\n        ),\n        'sent_at': '1st day of the month'\n    },\n    MONTHLY_PAYMENT_FOLLOWUP_NOTIF: {\n        'recipient': 'Organizer',\n        'subject': u'Past Due: {date} - Monthly service fee invoice for {event_name}',\n        'message': (\n            u\"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}.\" +\n            u\"<br/> That payment for the same is past the due date. <a href='{payment_url}'>Click here</a> to \"\n            u\"view your invoice and complete the payment to prevent loss of functionality.\"\n            u\"<br><br><em>Thank you for using {app_name}.</em>\"\n        ),\n        'sent_at': '15th day of the month'\n    },\n    TICKET_PURCHASED: {\n        'recipient': 'User',\n        'title': u'Your order invoice and tickets ({invoice_id})',\n        'message': (\n            u\"Your order has been processed successfully.\"\n            u\"<br><br><a href='{order_url}' class='btn btn-info btn-sm'>View Invoice</a>\"\n        )\n    },\n    TICKET_PURCHASED_ATTENDEE: {\n        'recipient': 'User',\n        'title': u'Your ticket for {event_name}',\n        'message': (\n            u\"Your order has been processed successfully.\"\n            u\"<br><br><a href='{pdf_url}' class='btn btn-info btn-sm'>View PDF</a>\"\n        )\n    },\n    TICKET_PURCHASED_ORGANIZER: {\n        'recipient': 'Organizer',\n        'title': u'New ticket purchase for {event_name} : ({invoice_id}) ',\n        'message': (\n            u\"The order has been processed successfully.\"\n            u\"<br><br><a href='{order_url}' class='btn btn-info btn-sm'>View Invoice</a>\"\n        )\n    },\n    TICKET_RESEND_ORGANIZER: {\n        'recipient': 'Organizer',\n        'title': u'Email resent for {event_name} by {buyer_email} ({invoice_id}) ',\n        'message': (\n            u\"Email has been sent successfully.\"\n        )\n    },\n    TICKET_CANCELLED: {\n        'recipient': 'User',\n        'subject': u'Your order for {event_name} has been cancelled ({invoice_id})',\n        'message': (\n            u\"Your order for {event_name} has been cancelled by the organizer\"\n            u\"<br/>Please contact the organizer for more info\" +\n            u\"<br/>Message from the organizer: {cancel_note}.\"\n        )\n    },\n    TICKET_CANCELLED_ORGANIZER: {\n        'recipient': 'User',\n        'subject': u'Order ({invoice_id}) has been cancelled',\n        'message': (\n            u\"Order ({invoice_id}) has been cancelled\"\n            u\"<br/>Cancel Note: {cancel_note}.\"\n        )\n    },\n    USER_CHANGE_EMAIL: {\n        'recipient': 'User',\n        'title': u'Your email has been changed',\n        'message': (\n            u\"Your email has been changed from {email} to {new_email}.<br>Please verify your new email.\"\n        )\n    },\n    PASSWORD_CHANGE: {\n        'recipient': 'User',\n        'subject': u'{app_name}: Password Change',\n        'message': (\n            u\"Your password has been successfully changed.\"\n        )\n    },\n    AFTER_EVENT: {\n        'title': u'Event {event_name} completed',\n        'message': u\"\"\"The event <strong>{event_name}</strong> has been completed.<br><br>\"\"\",\n        'recipient': 'User',\n    },\n    EVENT_PUBLISH: {\n        'title': u'Event {event_name} has been published',\n        'message': u\"\"\"The event <strong>{event_name}</strong> has been published.<br><br>\n                   <a href='{link}' class='btn btn-info btn-sm'>View Event</a>\"\"\",\n        'recipient': 'User',\n    },\n    EVENT_ROLE: {\n        'title': u'Invitation to be {role_name} at {event_name}',\n        'message': u\"\"\"You've been invited to be a <strong>{role_name}</strong>\n            at <strong>{event_name}</strong>.<br><br>\n            To accept the role please sign up using the following link: <a href='{link}' target='_blank'>Link</a>.\"\"\",\n        'recipient': 'User',\n    },\n    NEW_SESSION: {\n        'title': u'New session proposal for {event_name}',\n        'message': u\"\"\"The event <strong>{event_name}</strong> has received\n             a new session proposal.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Session</a>\"\"\",\n        'recipient': 'Organizer',\n    },\n    SESSION_SCHEDULE: {\n        'title': u'Schedule for Session {session_name} has been changed',\n        'message': u\"\"\"The schedule for session <strong>{session_name}</strong>\n             has been changed.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Session</a>\"\"\",\n        'recipient': 'Organizer, Speaker',\n    },\n    NEXT_EVENT: {\n        'title': u'Event {event_name} is coming soon',\n        'message': u\"\"\"Here are upcoming events: {up_coming_events}.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Event</a>\"\"\",\n        'recipient': 'Organizer, Speaker',\n    },\n    SESSION_ACCEPT_REJECT: {\n        'title': u'Session {session_name} has been {acceptance}',\n        'message': u\"\"\"The session <strong>{session_name}</strong> has been\n             <strong>{acceptance}</strong> by the Organizer.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Session</a>\"\"\",\n        'recipient': 'Speaker',\n    },\n    INVITE_PAPERS: {\n        'title': u'Invitation to Submit Papers for {event_name}',\n        'message': u\"\"\"You have been invited to submit papers for <strong>{event_name}</strong>.<br><br>\n            <a href='{cfs_link}' class='btn btn-info btn-sm'>View Call for Speakers</a>\n            <a href='{submit_link}' class='btn btn-success btn-sm'>Submit</a>\"\"\",\n        'recipient': 'Speaker',\n    },\n}\n", "path": "app/api/helpers/system_notifications.py"}], "after_files": [{"content": "\"\"\"\nUser Notification Structures\n\"\"\"\nfrom app.models.notification import (\n    EVENT_ROLE,\n    NEW_SESSION,\n    SESSION_SCHEDULE,\n    NEXT_EVENT,\n    SESSION_ACCEPT_REJECT,\n    INVITE_PAPERS,\n    AFTER_EVENT,\n    EVENT_PUBLISH,\n    USER_CHANGE_EMAIL,\n    PASSWORD_CHANGE,\n    TICKET_PURCHASED,\n    TICKET_RESEND_ORGANIZER,\n    EVENT_EXPORT_FAIL,\n    EVENT_EXPORTED,\n    EVENT_IMPORT_FAIL,\n    EVENT_IMPORTED,\n    MONTHLY_PAYMENT_NOTIF,\n    MONTHLY_PAYMENT_FOLLOWUP_NOTIF,\n    TICKET_PURCHASED_ORGANIZER,\n    TICKET_PURCHASED_ATTENDEE,\n    TICKET_CANCELLED,\n    TICKET_CANCELLED_ORGANIZER\n)\n\nNOTIFS = {\n    EVENT_EXPORTED: {\n        'recipient': 'User',\n        'title': u'Event {event_name} has been exported',\n        'message': (\n            u\"Event <strong>{event_name}</strong> has been exported successfully.\"\n            u\"<br><br><a href='{download_url}' class='btn btn-info btn-sm'>Download</a>\"\n        )\n    },\n    EVENT_EXPORT_FAIL: {\n        'recipient': 'User',\n        'title': u'Export of event {event_name} failed',\n        'message': (\n            u\"The following error occurred:<br>\"\n            u\"<pre>{error_text}</pre>\"\n        )\n    },\n    EVENT_IMPORTED: {\n        'recipient': 'User',\n        'title': u'Event {event_name} has been imported',\n        'message': (\n            u\"Event <strong>{event_name}</strong> has been imported successfully.\"\n            u\"<br><br><a href='{event_url}' class='btn btn-info btn-sm'>View Event</a>\"\n        )\n    },\n    EVENT_IMPORT_FAIL: {\n        'recipient': 'User',\n        'title': u'Import of event failed',\n        'message': (\n            u\"The following error occurred:<br>\"\n            u\"<pre>{error_text}</pre>\"\n        )\n    },\n    MONTHLY_PAYMENT_NOTIF: {\n        'recipient': 'Organizer',\n        'subject': u'{date} - Monthly service fee invoice for {event_name}',\n        'message': (\n            u\"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}.\" +\n            u\"<br/> That payment for the same has to be made in two weeks. <a href='{payment_url}'>Click here</a> to \"\n            u\"view your invoice and complete the payment.\"\n            u\"<br><br><em>Thank you for using {app_name}.</em>\"\n        ),\n        'sent_at': '1st day of the month'\n    },\n    MONTHLY_PAYMENT_FOLLOWUP_NOTIF: {\n        'recipient': 'Organizer',\n        'subject': u'Past Due: {date} - Monthly service fee invoice for {event_name}',\n        'message': (\n            u\"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}.\" +\n            u\"<br/> That payment for the same is past the due date. <a href='{payment_url}'>Click here</a> to \"\n            u\"view your invoice and complete the payment to prevent loss of functionality.\"\n            u\"<br><br><em>Thank you for using {app_name}.</em>\"\n        ),\n        'sent_at': '15th day of the month'\n    },\n    TICKET_PURCHASED: {\n        'recipient': 'User',\n        'title': u'Your order invoice and tickets ({invoice_id})',\n        'message': (\n            u\"Your order has been processed successfully.\"\n            u\"<br><br><a href='{order_url}' class='btn btn-info btn-sm'>View Invoice</a>\"\n        )\n    },\n    TICKET_PURCHASED_ATTENDEE: {\n        'recipient': 'User',\n        'title': u'Your ticket for {event_name}',\n        'message': (\n            u\"Your order has been processed successfully.\"\n            u\"<br><br><a href='{pdf_url}' class='btn btn-info btn-sm'>View PDF</a>\"\n        )\n    },\n    TICKET_PURCHASED_ORGANIZER: {\n        'recipient': 'Organizer',\n        'title': u'New ticket purchase for {event_name} : ({invoice_id}) ',\n        'message': (\n            u\"The order has been processed successfully.\"\n            u\"<br><br><a href='{order_url}' class='btn btn-info btn-sm'>View Invoice</a>\"\n        )\n    },\n    TICKET_RESEND_ORGANIZER: {\n        'recipient': 'Organizer',\n        'title': u'Email resent for {event_name} by {buyer_email} ({invoice_id}) ',\n        'message': (\n            u\"Email has been sent successfully.\"\n        )\n    },\n    TICKET_CANCELLED: {\n        'recipient': 'User',\n        'title': u'Your order for {event_name} has been cancelled ({invoice_id})',\n        'message': (\n            u\"Your order for {event_name} has been cancelled by the organizer\"\n            u\"<br/>Please contact the organizer for more info\" +\n            u\"<br/>Message from the organizer: {cancel_note}.\"\n        )\n    },\n    TICKET_CANCELLED_ORGANIZER: {\n        'recipient': 'User',\n        'title': u'Order ({invoice_id}) has been cancelled',\n        'message': (\n            u\"Order ({invoice_id}) has been cancelled\"\n            u\"<br/>Cancel Note: {cancel_note}.\"\n        )\n    },\n    USER_CHANGE_EMAIL: {\n        'recipient': 'User',\n        'title': u'Your email has been changed',\n        'message': (\n            u\"Your email has been changed from {email} to {new_email}.<br>Please verify your new email.\"\n        )\n    },\n    PASSWORD_CHANGE: {\n        'recipient': 'User',\n        'subject': u'{app_name}: Password Change',\n        'message': (\n            u\"Your password has been successfully changed.\"\n        )\n    },\n    AFTER_EVENT: {\n        'title': u'Event {event_name} completed',\n        'message': u\"\"\"The event <strong>{event_name}</strong> has been completed.<br><br>\"\"\",\n        'recipient': 'User',\n    },\n    EVENT_PUBLISH: {\n        'title': u'Event {event_name} has been published',\n        'message': u\"\"\"The event <strong>{event_name}</strong> has been published.<br><br>\n                   <a href='{link}' class='btn btn-info btn-sm'>View Event</a>\"\"\",\n        'recipient': 'User',\n    },\n    EVENT_ROLE: {\n        'title': u'Invitation to be {role_name} at {event_name}',\n        'message': u\"\"\"You've been invited to be a <strong>{role_name}</strong>\n            at <strong>{event_name}</strong>.<br><br>\n            To accept the role please sign up using the following link: <a href='{link}' target='_blank'>Link</a>.\"\"\",\n        'recipient': 'User',\n    },\n    NEW_SESSION: {\n        'title': u'New session proposal for {event_name}',\n        'message': u\"\"\"The event <strong>{event_name}</strong> has received\n             a new session proposal.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Session</a>\"\"\",\n        'recipient': 'Organizer',\n    },\n    SESSION_SCHEDULE: {\n        'title': u'Schedule for Session {session_name} has been changed',\n        'message': u\"\"\"The schedule for session <strong>{session_name}</strong>\n             has been changed.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Session</a>\"\"\",\n        'recipient': 'Organizer, Speaker',\n    },\n    NEXT_EVENT: {\n        'title': u'Event {event_name} is coming soon',\n        'message': u\"\"\"Here are upcoming events: {up_coming_events}.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Event</a>\"\"\",\n        'recipient': 'Organizer, Speaker',\n    },\n    SESSION_ACCEPT_REJECT: {\n        'title': u'Session {session_name} has been {acceptance}',\n        'message': u\"\"\"The session <strong>{session_name}</strong> has been\n             <strong>{acceptance}</strong> by the Organizer.<br><br>\n            <a href='{link}' class='btn btn-info btn-sm'>View Session</a>\"\"\",\n        'recipient': 'Speaker',\n    },\n    INVITE_PAPERS: {\n        'title': u'Invitation to Submit Papers for {event_name}',\n        'message': u\"\"\"You have been invited to submit papers for <strong>{event_name}</strong>.<br><br>\n            <a href='{cfs_link}' class='btn btn-info btn-sm'>View Call for Speakers</a>\n            <a href='{submit_link}' class='btn btn-success btn-sm'>Submit</a>\"\"\",\n        'recipient': 'Speaker',\n    },\n}\n", "path": "app/api/helpers/system_notifications.py"}]}