We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Server crashing on order PATCH
```
KeyError: 'mytickets_url'
(16 additional frame(s) were not displayed)
...
  File "flask_rest_jsonapi/decorators.py", line 56, in wrapper
    return func(*args, **kwargs)
  File "flask_rest_jsonapi/resource.py", line 310, in patch
    self._data_layer.update_object(obj, data, kwargs)
  File "flask_rest_jsonapi/data_layers/alchemy.py", line 144, in update_object
    self.after_update_object(obj, data, view_kwargs)
  File "app/api/orders.py", line 601, in after_update_object
    attachments=[ticket_path, invoice_path],
  File "app/api/helpers/mail.py", line 354, in send_email_to_attendees
    event_name=order.event.name,
```

Rolled back the release

--- 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_mails.py`
Content:
```
1 """
2 All the System mails
3 Register a mail here before using it
4 """
5 from app.models.mail import (
6     AFTER_EVENT,
7     EVENT_EXPORT_FAIL,
8     EVENT_EXPORTED,
9     EVENT_IMPORT_FAIL,
10     EVENT_IMPORTED,
11     EVENT_PUBLISH,
12     EVENT_ROLE,
13     INVITE_PAPERS,
14     MAIL_TO_EXPIRED_ORDERS,
15     MONTHLY_PAYMENT_EMAIL,
16     MONTHLY_PAYMENT_FOLLOWUP_EMAIL,
17     NEW_SESSION,
18     NEXT_EVENT,
19     PASSWORD_CHANGE,
20     PASSWORD_RESET,
21     PASSWORD_RESET_AND_VERIFY,
22     SESSION_ACCEPT_REJECT,
23     SESSION_SCHEDULE,
24     TEST_MAIL,
25     TICKET_CANCELLED,
26     TICKET_PURCHASED,
27     TICKET_PURCHASED_ATTENDEE,
28     TICKET_PURCHASED_ORGANIZER,
29     USER_CHANGE_EMAIL,
30     USER_CONFIRM,
31     USER_EVENT_ROLE,
32     USER_REGISTER,
33     USER_REGISTER_WITH_PASSWORD,
34 )
35 
36 MAILS = {
37     EVENT_PUBLISH: {
38         'recipient': 'Owner, Organizer, Speaker',
39         'subject': u'{event_name} is Live',
40         'message': (
41             u"Hi {email}<br/>"
42             + u"Event, {event_name}, is up and running and ready for action. Go ahead and check it out."
43             + u"<br/> Visit this link to view it: {link}"
44         ),
45     },
46     INVITE_PAPERS: {
47         'recipient': 'Speaker',
48         'subject': u'Invitation to Submit Papers for {event_name}',
49         'message': (
50             u"Hi {email}<br/>"
51             + u"You are invited to submit papers for event: {event_name}"
52             + u"<br/> Visit this link to fill up details: {link}"
53         ),
54     },
55     SESSION_ACCEPT_REJECT: {
56         'recipient': 'Speaker',
57         'subject': u'Session {session_name} has been {acceptance}',
58         'message': (
59             u"Hi {email},<br/>"
60             + u"The session <strong>{session_name}</strong> has been <strong>{acceptance}</strong> by the organizer. "
61             + u"<br/> Visit this link to view the session: {link}"
62         ),
63     },
64     SESSION_SCHEDULE: {
65         'recipient': 'Owner, Organizer, Speaker',
66         'subject': u'Schedule for Session {session_name} has been changed',
67         'message': (
68             u"Hi {email},<br/>"
69             + u"The schedule for session <strong>{session_name}</strong> has been changed. "
70             + u"<br/> Visit this link to view the session: {link}"
71         ),
72     },
73     NEXT_EVENT: {
74         'recipient': 'Owner, Organizer, Speaker',
75         'subject': u'Event {event_name} is coming soon',
76         'message': (
77             u"Hi {email},<br/>"
78             + u"Here are the upcoming events: {up_coming_events} .Get ready!! "
79             + u"<br/> Visit this link to view the event: {link}"
80         ),
81     },
82     AFTER_EVENT: {
83         'recipient': 'Owner, Organizer, Speaker',
84         'subject': u'Event {event_name} is over',
85         'message': (
86             u"Hi {email},<br/>"
87             + u"Thank You for participating in our event. We hope you enjoyed it. "
88             u"Please check out other upcoming events around you on {url} <br />"
89         ),
90         'sent_at': '1 day after the event',
91     },
92     NEW_SESSION: {
93         'recipient': 'Owner, Organizer',
94         'subject': u'New session proposal for {event_name}',
95         'message': (
96             u"Hi {email},<br/>"
97             + u"The event <strong>{event_name}</strong> has received a new session proposal. "
98             + u"<br/> Visit this link to view the session: <a href='{link}' target='_blank'>{link}</a>"
99         ),
100     },
101     USER_REGISTER: {
102         'recipient': 'User',
103         'subject': u'Account Created on {app_name}',
104         'message': (
105             u"Your Account Has Been Created! Congratulations!"
106             + u"<br/> Your login: {email}"
107         ),
108     },
109     USER_REGISTER_WITH_PASSWORD: {
110         'recipient': 'User',
111         'subject': u'Welcome to {app_name}',
112         'message': (
113             u"Your Account Has Been Created! Congratulations!"
114             + u"<br/> <strong>Your login:</strong><br><strong>Email:</strong> {email}<br>"
115         ),
116     },
117     USER_CONFIRM: {
118         'recipient': 'User',
119         'subject': u'Email Confirmation to Create Account for Open-Event',
120         'message': (
121             u"Hi {email},<br/>"
122             + u"Please visit this link to confirm your email:  <a href='{link}' target='_blank'>{link}</a>"
123         ),
124     },
125     USER_CHANGE_EMAIL: {
126         'recipient': 'User',
127         'subject': u'Your email has been already changed',
128         'message': (
129             u"Hi {email},<br/>"
130             + u"Your email has been already changed from {email} to {new_email}. You should verify your new email"
131         ),
132     },
133     PASSWORD_RESET: {
134         'recipient': 'User',
135         'subject': u'{app_name}: Password Reset',
136         'message': (
137             u"Please use the following link to reset your password.<br> <a href='{link}' target='_blank'>{link}</a>"
138             + " Or paste this token in your {app_name} App: {token} "
139         ),
140     },
141     PASSWORD_RESET_AND_VERIFY: {
142         'recipient': 'User',
143         'subject': u'{app_name}: Reset your password and verify your account',
144         'message': (
145             u"Please use the following link to reset your password and verify your account."
146             + "<br> <a href='{link}' target='_blank'>{link}</a>"
147         ),
148     },
149     PASSWORD_CHANGE: {
150         'recipient': 'User',
151         'subject': u'{app_name}: Password Change',
152         'message': (
153             u"Your password has been successfully changed. Please login with your new password."
154         ),
155     },
156     EVENT_ROLE: {
157         'recipient': 'User',
158         'subject': u'Invitation to be {role} at {event}',
159         'message': (
160             u"Hello {email},<br><br>"
161             + u"You've been invited to be a <strong>{role}</strong> at <strong>{event}</strong>.<br>"
162             + u"To accept the role please sign up using the following link: <a href='{link}' target='_blank'>Link</a>."
163         ),
164     },
165     USER_EVENT_ROLE: {
166         'recipient': 'User',
167         'subject': u'Invitation to be {role} at {event}',
168         'message': (
169             u"Hello {email},<br><br>"
170             + u"You've been invited to be a <strong>{role}</strong> at <strong>{event}</strong>.<br>"
171             + u"To accept the role please go to the following link: <a href='{link}' target='_blank'>Link</a>."
172         ),
173     },
174     TICKET_PURCHASED: {
175         'recipient': 'User',
176         'subject': u'Your order invoice and tickets for {event_name} ({invoice_id}) ',
177         'message': (
178             u"Hi, this is a confirmation mail of your tickets for the event {event_name}"
179             u"<br/>Your order has been processed successfully."
180             + u"<br/> You can find your Tickets and Order Invoice attached to this mail."
181             u"<br><br><em>Looking forward to seeing you at the event."
182             u"<br/>Login to manage your orders at {frontend_url} </em>"
183         ),
184     },
185     TICKET_PURCHASED_ATTENDEE: {
186         'recipient': 'Attendee',
187         'subject': u'Your tickets for {event_name} ({invoice_id}) ',
188         'message': (
189             u"Hi, this is a confirmation mail of your tickets for the event {event_name}"
190             u"<br/>Your order has been processed successfully."
191             + u"<br/> Your tickets & invoice have been enclosed."
192             u"<br><br>You can also download your tickets in <b>My Tickets</b> section."
193             u"<br/>Login to manage the orders at <a href='{mytickets_url}' target='_blank'>{mytickets_url}</a> </em>"
194             u"<br><br><em>Looking forward to seeing you at the event."
195         ),
196     },
197     TICKET_PURCHASED_ORGANIZER: {
198         'recipient': 'Owner, Organizer, Coorganizer',
199         'subject': u'New ticket purchase for {event_name} by {buyer_email} ({invoice_id}) ',
200         'message': (
201             u"Hi, {buyer_email} just bought tickets for the event {event_name}"
202             u"<br/>The order has been processed successfully."
203             + u"<br/> <a href='{order_url}'>Click here</a> to view/download the invoice."
204             u"<br/>Login to manage the orders at <a href='{frontend_url}' target='_blank'>{frontend_url}</a> </em>"
205         ),
206     },
207     TICKET_CANCELLED: {
208         'recipient': 'User',
209         'subject': u'Your order for {event_name} has been cancelled ({invoice_id})',
210         'message': (
211             u"Hello,"
212             u"<br/>your order for {event_name} has been cancelled by the organizer."
213             u"<br/>Please contact the organizer for more info." + u"{cancel_msg}"
214             u"<br/>To manage orders please login to <a href='{frontend_url}' target='_blank'>{frontend_url}</a>"
215             u"and visit \"My Tickets\"."
216             u"<br/>Best regards,"
217             u"<br/>{app_name} Team"
218         ),
219     },
220     EVENT_EXPORTED: {
221         'recipient': 'User',
222         'subject': u'Event {event_name} has been exported',
223         'message': (
224             u"Click on the following link to download the event."
225             + u"<br> <a href='{download_url}'>Download</a>"
226         ),
227     },
228     EVENT_EXPORT_FAIL: {
229         'recipient': 'User',
230         'subject': u'Export of event {event_name} failed',
231         'message': (u"The error was as follows - <br>" + u"<pre>{error_text}</pre>"),
232     },
233     MAIL_TO_EXPIRED_ORDERS: {
234         'recipient': 'User',
235         'subject': u'Tickets for {event_name} are still available ',
236         'message': (
237             u"This is just a gentle reminder that the payment for your order {invoice_id} is still left."
238             + u"<br/> The tickets for this event are still available. <a href='{order_url}'>Click here</a> to "
239             u"purchase your ticket for this event."
240             u"<br><br><em>Looking forward to seeing you at the event.</em>"
241         ),
242     },
243     MONTHLY_PAYMENT_EMAIL: {
244         'recipient': 'Owner, Organizer',
245         'subject': u'{date} - Monthly service fee invoice for {event_name}',
246         'message': (
247             u"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}."
248             + u"<br/> That payment for the same has to be made in two weeks. <a href='{payment_url}'>Click here</a> to "
249             u"view your invoice and complete the payment."
250             u"<br><br><em>Thank you for using {app_name}.</em>"
251         ),
252         'sent_at': '1st day of the month',
253     },
254     MONTHLY_PAYMENT_FOLLOWUP_EMAIL: {
255         'recipient': 'Owner, Organizer',
256         'subject': u'Past Due: {date} - Monthly service fee invoice for {event_name}',
257         'message': (
258             u"The total service fee for the ticket sales of {event_name} in the month of {date} is {amount}."
259             + u"<br/> That payment for the same is past the due date. <a href='{payment_url}'>Click here</a> to "
260             u"view your invoice and complete the payment to prevent loss of functionality."
261             u"<br><br><em>Thank you for using {app_name}.</em>"
262         ),
263         'sent_at': '15th day of the month',
264     },
265     EVENT_IMPORTED: {
266         'recipient': 'User',
267         'subject': u'Event {event_name} has been imported',
268         'message': (
269             u"Click on the following link to manage your event"
270             + u"<br> <a href='{event_url}'>Link</a>"
271         ),
272     },
273     EVENT_IMPORT_FAIL: {
274         'recipient': 'User',
275         'subject': u'Import of event failed',
276         'message': (u"The error was as follows - <br>" + u"<pre>{error_text}</pre>"),
277     },
278     TEST_MAIL: {
279         'recipient': 'User',
280         'subject': u'Test Mail Subject',
281         'message': (u"This is a  <strong> Test </strong> E-mail."),
282     },
283 }
284
```
--- 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_mails.py b/app/api/helpers/system_mails.py
--- a/app/api/helpers/system_mails.py
+++ b/app/api/helpers/system_mails.py
@@ -190,7 +190,7 @@
             u"<br/>Your order has been processed successfully."
             + u"<br/> Your tickets & invoice have been enclosed."
             u"<br><br>You can also download your tickets in <b>My Tickets</b> section."
-            u"<br/>Login to manage the orders at <a href='{mytickets_url}' target='_blank'>{mytickets_url}</a> </em>"
+            u"<br/>Login to manage the orders at <a href='{my_tickets_url}' target='_blank'>{my_tickets_url}</a> </em>"
             u"<br><br><em>Looking forward to seeing you at the event."
         ),
     },

{"golden_diff": "diff --git a/app/api/helpers/system_mails.py b/app/api/helpers/system_mails.py\n--- a/app/api/helpers/system_mails.py\n+++ b/app/api/helpers/system_mails.py\n@@ -190,7 +190,7 @@\n             u\"<br/>Your order has been processed successfully.\"\n             + u\"<br/> Your tickets & invoice have been enclosed.\"\n             u\"<br><br>You can also download your tickets in <b>My Tickets</b> section.\"\n-            u\"<br/>Login to manage the orders at <a href='{mytickets_url}' target='_blank'>{mytickets_url}</a> </em>\"\n+            u\"<br/>Login to manage the orders at <a href='{my_tickets_url}' target='_blank'>{my_tickets_url}</a> </em>\"\n             u\"<br><br><em>Looking forward to seeing you at the event.\"\n         ),\n     },\n", "issue": "Server crashing on order PATCH\n```\r\nKeyError: 'mytickets_url'\r\n(16 additional frame(s) were not displayed)\r\n...\r\n  File \"flask_rest_jsonapi/decorators.py\", line 56, in wrapper\r\n    return func(*args, **kwargs)\r\n  File \"flask_rest_jsonapi/resource.py\", line 310, in patch\r\n    self._data_layer.update_object(obj, data, kwargs)\r\n  File \"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 \"app/api/orders.py\", line 601, in after_update_object\r\n    attachments=[ticket_path, invoice_path],\r\n  File \"app/api/helpers/mail.py\", line 354, in send_email_to_attendees\r\n    event_name=order.event.name,\r\n```\r\n\r\nRolled back the release\n", "before_files": [{"content": "\"\"\"\nAll the System mails\nRegister a mail here before using it\n\"\"\"\nfrom app.models.mail import (\n    AFTER_EVENT,\n    EVENT_EXPORT_FAIL,\n    EVENT_EXPORTED,\n    EVENT_IMPORT_FAIL,\n    EVENT_IMPORTED,\n    EVENT_PUBLISH,\n    EVENT_ROLE,\n    INVITE_PAPERS,\n    MAIL_TO_EXPIRED_ORDERS,\n    MONTHLY_PAYMENT_EMAIL,\n    MONTHLY_PAYMENT_FOLLOWUP_EMAIL,\n    NEW_SESSION,\n    NEXT_EVENT,\n    PASSWORD_CHANGE,\n    PASSWORD_RESET,\n    PASSWORD_RESET_AND_VERIFY,\n    SESSION_ACCEPT_REJECT,\n    SESSION_SCHEDULE,\n    TEST_MAIL,\n    TICKET_CANCELLED,\n    TICKET_PURCHASED,\n    TICKET_PURCHASED_ATTENDEE,\n    TICKET_PURCHASED_ORGANIZER,\n    USER_CHANGE_EMAIL,\n    USER_CONFIRM,\n    USER_EVENT_ROLE,\n    USER_REGISTER,\n    USER_REGISTER_WITH_PASSWORD,\n)\n\nMAILS = {\n    EVENT_PUBLISH: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'{event_name} is Live',\n        'message': (\n            u\"Hi {email}<br/>\"\n            + u\"Event, {event_name}, is up and running and ready for action. Go ahead and check it out.\"\n            + u\"<br/> Visit this link to view it: {link}\"\n        ),\n    },\n    INVITE_PAPERS: {\n        'recipient': 'Speaker',\n        'subject': u'Invitation to Submit Papers for {event_name}',\n        'message': (\n            u\"Hi {email}<br/>\"\n            + u\"You are invited to submit papers for event: {event_name}\"\n            + u\"<br/> Visit this link to fill up details: {link}\"\n        ),\n    },\n    SESSION_ACCEPT_REJECT: {\n        'recipient': 'Speaker',\n        'subject': u'Session {session_name} has been {acceptance}',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"The session <strong>{session_name}</strong> has been <strong>{acceptance}</strong> by the organizer. \"\n            + u\"<br/> Visit this link to view the session: {link}\"\n        ),\n    },\n    SESSION_SCHEDULE: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'Schedule for Session {session_name} has been changed',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"The schedule for session <strong>{session_name}</strong> has been changed. \"\n            + u\"<br/> Visit this link to view the session: {link}\"\n        ),\n    },\n    NEXT_EVENT: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'Event {event_name} is coming soon',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Here are the upcoming events: {up_coming_events} .Get ready!! \"\n            + u\"<br/> Visit this link to view the event: {link}\"\n        ),\n    },\n    AFTER_EVENT: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'Event {event_name} is over',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Thank You for participating in our event. We hope you enjoyed it. \"\n            u\"Please check out other upcoming events around you on {url} <br />\"\n        ),\n        'sent_at': '1 day after the event',\n    },\n    NEW_SESSION: {\n        'recipient': 'Owner, Organizer',\n        'subject': u'New session proposal for {event_name}',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"The event <strong>{event_name}</strong> has received a new session proposal. \"\n            + u\"<br/> Visit this link to view the session: <a href='{link}' target='_blank'>{link}</a>\"\n        ),\n    },\n    USER_REGISTER: {\n        'recipient': 'User',\n        'subject': u'Account Created on {app_name}',\n        'message': (\n            u\"Your Account Has Been Created! Congratulations!\"\n            + u\"<br/> Your login: {email}\"\n        ),\n    },\n    USER_REGISTER_WITH_PASSWORD: {\n        'recipient': 'User',\n        'subject': u'Welcome to {app_name}',\n        'message': (\n            u\"Your Account Has Been Created! Congratulations!\"\n            + u\"<br/> <strong>Your login:</strong><br><strong>Email:</strong> {email}<br>\"\n        ),\n    },\n    USER_CONFIRM: {\n        'recipient': 'User',\n        'subject': u'Email Confirmation to Create Account for Open-Event',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Please visit this link to confirm your email:  <a href='{link}' target='_blank'>{link}</a>\"\n        ),\n    },\n    USER_CHANGE_EMAIL: {\n        'recipient': 'User',\n        'subject': u'Your email has been already changed',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Your email has been already changed from {email} to {new_email}. You should verify your new email\"\n        ),\n    },\n    PASSWORD_RESET: {\n        'recipient': 'User',\n        'subject': u'{app_name}: Password Reset',\n        'message': (\n            u\"Please use the following link to reset your password.<br> <a href='{link}' target='_blank'>{link}</a>\"\n            + \" Or paste this token in your {app_name} App: {token} \"\n        ),\n    },\n    PASSWORD_RESET_AND_VERIFY: {\n        'recipient': 'User',\n        'subject': u'{app_name}: Reset your password and verify your account',\n        'message': (\n            u\"Please use the following link to reset your password and verify your account.\"\n            + \"<br> <a href='{link}' target='_blank'>{link}</a>\"\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. Please login with your new password.\"\n        ),\n    },\n    EVENT_ROLE: {\n        'recipient': 'User',\n        'subject': u'Invitation to be {role} at {event}',\n        'message': (\n            u\"Hello {email},<br><br>\"\n            + u\"You've been invited to be a <strong>{role}</strong> at <strong>{event}</strong>.<br>\"\n            + u\"To accept the role please sign up using the following link: <a href='{link}' target='_blank'>Link</a>.\"\n        ),\n    },\n    USER_EVENT_ROLE: {\n        'recipient': 'User',\n        'subject': u'Invitation to be {role} at {event}',\n        'message': (\n            u\"Hello {email},<br><br>\"\n            + u\"You've been invited to be a <strong>{role}</strong> at <strong>{event}</strong>.<br>\"\n            + u\"To accept the role please go to the following link: <a href='{link}' target='_blank'>Link</a>.\"\n        ),\n    },\n    TICKET_PURCHASED: {\n        'recipient': 'User',\n        'subject': u'Your order invoice and tickets for {event_name} ({invoice_id}) ',\n        'message': (\n            u\"Hi, this is a confirmation mail of your tickets for the event {event_name}\"\n            u\"<br/>Your order has been processed successfully.\"\n            + u\"<br/> You can find your Tickets and Order Invoice attached to this mail.\"\n            u\"<br><br><em>Looking forward to seeing you at the event.\"\n            u\"<br/>Login to manage your orders at {frontend_url} </em>\"\n        ),\n    },\n    TICKET_PURCHASED_ATTENDEE: {\n        'recipient': 'Attendee',\n        'subject': u'Your tickets for {event_name} ({invoice_id}) ',\n        'message': (\n            u\"Hi, this is a confirmation mail of your tickets for the event {event_name}\"\n            u\"<br/>Your order has been processed successfully.\"\n            + u\"<br/> Your tickets & invoice have been enclosed.\"\n            u\"<br><br>You can also download your tickets in <b>My Tickets</b> section.\"\n            u\"<br/>Login to manage the orders at <a href='{mytickets_url}' target='_blank'>{mytickets_url}</a> </em>\"\n            u\"<br><br><em>Looking forward to seeing you at the event.\"\n        ),\n    },\n    TICKET_PURCHASED_ORGANIZER: {\n        'recipient': 'Owner, Organizer, Coorganizer',\n        'subject': u'New ticket purchase for {event_name} by {buyer_email} ({invoice_id}) ',\n        'message': (\n            u\"Hi, {buyer_email} just bought tickets for the event {event_name}\"\n            u\"<br/>The order has been processed successfully.\"\n            + u\"<br/> <a href='{order_url}'>Click here</a> to view/download the invoice.\"\n            u\"<br/>Login to manage the orders at <a href='{frontend_url}' target='_blank'>{frontend_url}</a> </em>\"\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\"Hello,\"\n            u\"<br/>your order for {event_name} has been cancelled by the organizer.\"\n            u\"<br/>Please contact the organizer for more info.\" + u\"{cancel_msg}\"\n            u\"<br/>To manage orders please login to <a href='{frontend_url}' target='_blank'>{frontend_url}</a>\"\n            u\"and visit \\\"My Tickets\\\".\"\n            u\"<br/>Best regards,\"\n            u\"<br/>{app_name} Team\"\n        ),\n    },\n    EVENT_EXPORTED: {\n        'recipient': 'User',\n        'subject': u'Event {event_name} has been exported',\n        'message': (\n            u\"Click on the following link to download the event.\"\n            + u\"<br> <a href='{download_url}'>Download</a>\"\n        ),\n    },\n    EVENT_EXPORT_FAIL: {\n        'recipient': 'User',\n        'subject': u'Export of event {event_name} failed',\n        'message': (u\"The error was as follows - <br>\" + u\"<pre>{error_text}</pre>\"),\n    },\n    MAIL_TO_EXPIRED_ORDERS: {\n        'recipient': 'User',\n        'subject': u'Tickets for {event_name} are still available ',\n        'message': (\n            u\"This is just a gentle reminder that the payment for your order {invoice_id} is still left.\"\n            + u\"<br/> The tickets for this event are still available. <a href='{order_url}'>Click here</a> to \"\n            u\"purchase your ticket for this event.\"\n            u\"<br><br><em>Looking forward to seeing you at the event.</em>\"\n        ),\n    },\n    MONTHLY_PAYMENT_EMAIL: {\n        'recipient': 'Owner, 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_EMAIL: {\n        'recipient': 'Owner, 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    EVENT_IMPORTED: {\n        'recipient': 'User',\n        'subject': u'Event {event_name} has been imported',\n        'message': (\n            u\"Click on the following link to manage your event\"\n            + u\"<br> <a href='{event_url}'>Link</a>\"\n        ),\n    },\n    EVENT_IMPORT_FAIL: {\n        'recipient': 'User',\n        'subject': u'Import of event failed',\n        'message': (u\"The error was as follows - <br>\" + u\"<pre>{error_text}</pre>\"),\n    },\n    TEST_MAIL: {\n        'recipient': 'User',\n        'subject': u'Test Mail Subject',\n        'message': (u\"This is a  <strong> Test </strong> E-mail.\"),\n    },\n}\n", "path": "app/api/helpers/system_mails.py"}], "after_files": [{"content": "\"\"\"\nAll the System mails\nRegister a mail here before using it\n\"\"\"\nfrom app.models.mail import (\n    AFTER_EVENT,\n    EVENT_EXPORT_FAIL,\n    EVENT_EXPORTED,\n    EVENT_IMPORT_FAIL,\n    EVENT_IMPORTED,\n    EVENT_PUBLISH,\n    EVENT_ROLE,\n    INVITE_PAPERS,\n    MAIL_TO_EXPIRED_ORDERS,\n    MONTHLY_PAYMENT_EMAIL,\n    MONTHLY_PAYMENT_FOLLOWUP_EMAIL,\n    NEW_SESSION,\n    NEXT_EVENT,\n    PASSWORD_CHANGE,\n    PASSWORD_RESET,\n    PASSWORD_RESET_AND_VERIFY,\n    SESSION_ACCEPT_REJECT,\n    SESSION_SCHEDULE,\n    TEST_MAIL,\n    TICKET_CANCELLED,\n    TICKET_PURCHASED,\n    TICKET_PURCHASED_ATTENDEE,\n    TICKET_PURCHASED_ORGANIZER,\n    USER_CHANGE_EMAIL,\n    USER_CONFIRM,\n    USER_EVENT_ROLE,\n    USER_REGISTER,\n    USER_REGISTER_WITH_PASSWORD,\n)\n\nMAILS = {\n    EVENT_PUBLISH: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'{event_name} is Live',\n        'message': (\n            u\"Hi {email}<br/>\"\n            + u\"Event, {event_name}, is up and running and ready for action. Go ahead and check it out.\"\n            + u\"<br/> Visit this link to view it: {link}\"\n        ),\n    },\n    INVITE_PAPERS: {\n        'recipient': 'Speaker',\n        'subject': u'Invitation to Submit Papers for {event_name}',\n        'message': (\n            u\"Hi {email}<br/>\"\n            + u\"You are invited to submit papers for event: {event_name}\"\n            + u\"<br/> Visit this link to fill up details: {link}\"\n        ),\n    },\n    SESSION_ACCEPT_REJECT: {\n        'recipient': 'Speaker',\n        'subject': u'Session {session_name} has been {acceptance}',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"The session <strong>{session_name}</strong> has been <strong>{acceptance}</strong> by the organizer. \"\n            + u\"<br/> Visit this link to view the session: {link}\"\n        ),\n    },\n    SESSION_SCHEDULE: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'Schedule for Session {session_name} has been changed',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"The schedule for session <strong>{session_name}</strong> has been changed. \"\n            + u\"<br/> Visit this link to view the session: {link}\"\n        ),\n    },\n    NEXT_EVENT: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'Event {event_name} is coming soon',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Here are the upcoming events: {up_coming_events} .Get ready!! \"\n            + u\"<br/> Visit this link to view the event: {link}\"\n        ),\n    },\n    AFTER_EVENT: {\n        'recipient': 'Owner, Organizer, Speaker',\n        'subject': u'Event {event_name} is over',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Thank You for participating in our event. We hope you enjoyed it. \"\n            u\"Please check out other upcoming events around you on {url} <br />\"\n        ),\n        'sent_at': '1 day after the event',\n    },\n    NEW_SESSION: {\n        'recipient': 'Owner, Organizer',\n        'subject': u'New session proposal for {event_name}',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"The event <strong>{event_name}</strong> has received a new session proposal. \"\n            + u\"<br/> Visit this link to view the session: <a href='{link}' target='_blank'>{link}</a>\"\n        ),\n    },\n    USER_REGISTER: {\n        'recipient': 'User',\n        'subject': u'Account Created on {app_name}',\n        'message': (\n            u\"Your Account Has Been Created! Congratulations!\"\n            + u\"<br/> Your login: {email}\"\n        ),\n    },\n    USER_REGISTER_WITH_PASSWORD: {\n        'recipient': 'User',\n        'subject': u'Welcome to {app_name}',\n        'message': (\n            u\"Your Account Has Been Created! Congratulations!\"\n            + u\"<br/> <strong>Your login:</strong><br><strong>Email:</strong> {email}<br>\"\n        ),\n    },\n    USER_CONFIRM: {\n        'recipient': 'User',\n        'subject': u'Email Confirmation to Create Account for Open-Event',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Please visit this link to confirm your email:  <a href='{link}' target='_blank'>{link}</a>\"\n        ),\n    },\n    USER_CHANGE_EMAIL: {\n        'recipient': 'User',\n        'subject': u'Your email has been already changed',\n        'message': (\n            u\"Hi {email},<br/>\"\n            + u\"Your email has been already changed from {email} to {new_email}. You should verify your new email\"\n        ),\n    },\n    PASSWORD_RESET: {\n        'recipient': 'User',\n        'subject': u'{app_name}: Password Reset',\n        'message': (\n            u\"Please use the following link to reset your password.<br> <a href='{link}' target='_blank'>{link}</a>\"\n            + \" Or paste this token in your {app_name} App: {token} \"\n        ),\n    },\n    PASSWORD_RESET_AND_VERIFY: {\n        'recipient': 'User',\n        'subject': u'{app_name}: Reset your password and verify your account',\n        'message': (\n            u\"Please use the following link to reset your password and verify your account.\"\n            + \"<br> <a href='{link}' target='_blank'>{link}</a>\"\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. Please login with your new password.\"\n        ),\n    },\n    EVENT_ROLE: {\n        'recipient': 'User',\n        'subject': u'Invitation to be {role} at {event}',\n        'message': (\n            u\"Hello {email},<br><br>\"\n            + u\"You've been invited to be a <strong>{role}</strong> at <strong>{event}</strong>.<br>\"\n            + u\"To accept the role please sign up using the following link: <a href='{link}' target='_blank'>Link</a>.\"\n        ),\n    },\n    USER_EVENT_ROLE: {\n        'recipient': 'User',\n        'subject': u'Invitation to be {role} at {event}',\n        'message': (\n            u\"Hello {email},<br><br>\"\n            + u\"You've been invited to be a <strong>{role}</strong> at <strong>{event}</strong>.<br>\"\n            + u\"To accept the role please go to the following link: <a href='{link}' target='_blank'>Link</a>.\"\n        ),\n    },\n    TICKET_PURCHASED: {\n        'recipient': 'User',\n        'subject': u'Your order invoice and tickets for {event_name} ({invoice_id}) ',\n        'message': (\n            u\"Hi, this is a confirmation mail of your tickets for the event {event_name}\"\n            u\"<br/>Your order has been processed successfully.\"\n            + u\"<br/> You can find your Tickets and Order Invoice attached to this mail.\"\n            u\"<br><br><em>Looking forward to seeing you at the event.\"\n            u\"<br/>Login to manage your orders at {frontend_url} </em>\"\n        ),\n    },\n    TICKET_PURCHASED_ATTENDEE: {\n        'recipient': 'Attendee',\n        'subject': u'Your tickets for {event_name} ({invoice_id}) ',\n        'message': (\n            u\"Hi, this is a confirmation mail of your tickets for the event {event_name}\"\n            u\"<br/>Your order has been processed successfully.\"\n            + u\"<br/> Your tickets & invoice have been enclosed.\"\n            u\"<br><br>You can also download your tickets in <b>My Tickets</b> section.\"\n            u\"<br/>Login to manage the orders at <a href='{my_tickets_url}' target='_blank'>{my_tickets_url}</a> </em>\"\n            u\"<br><br><em>Looking forward to seeing you at the event.\"\n        ),\n    },\n    TICKET_PURCHASED_ORGANIZER: {\n        'recipient': 'Owner, Organizer, Coorganizer',\n        'subject': u'New ticket purchase for {event_name} by {buyer_email} ({invoice_id}) ',\n        'message': (\n            u\"Hi, {buyer_email} just bought tickets for the event {event_name}\"\n            u\"<br/>The order has been processed successfully.\"\n            + u\"<br/> <a href='{order_url}'>Click here</a> to view/download the invoice.\"\n            u\"<br/>Login to manage the orders at <a href='{frontend_url}' target='_blank'>{frontend_url}</a> </em>\"\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\"Hello,\"\n            u\"<br/>your order for {event_name} has been cancelled by the organizer.\"\n            u\"<br/>Please contact the organizer for more info.\" + u\"{cancel_msg}\"\n            u\"<br/>To manage orders please login to <a href='{frontend_url}' target='_blank'>{frontend_url}</a>\"\n            u\"and visit \\\"My Tickets\\\".\"\n            u\"<br/>Best regards,\"\n            u\"<br/>{app_name} Team\"\n        ),\n    },\n    EVENT_EXPORTED: {\n        'recipient': 'User',\n        'subject': u'Event {event_name} has been exported',\n        'message': (\n            u\"Click on the following link to download the event.\"\n            + u\"<br> <a href='{download_url}'>Download</a>\"\n        ),\n    },\n    EVENT_EXPORT_FAIL: {\n        'recipient': 'User',\n        'subject': u'Export of event {event_name} failed',\n        'message': (u\"The error was as follows - <br>\" + u\"<pre>{error_text}</pre>\"),\n    },\n    MAIL_TO_EXPIRED_ORDERS: {\n        'recipient': 'User',\n        'subject': u'Tickets for {event_name} are still available ',\n        'message': (\n            u\"This is just a gentle reminder that the payment for your order {invoice_id} is still left.\"\n            + u\"<br/> The tickets for this event are still available. <a href='{order_url}'>Click here</a> to \"\n            u\"purchase your ticket for this event.\"\n            u\"<br><br><em>Looking forward to seeing you at the event.</em>\"\n        ),\n    },\n    MONTHLY_PAYMENT_EMAIL: {\n        'recipient': 'Owner, 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_EMAIL: {\n        'recipient': 'Owner, 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    EVENT_IMPORTED: {\n        'recipient': 'User',\n        'subject': u'Event {event_name} has been imported',\n        'message': (\n            u\"Click on the following link to manage your event\"\n            + u\"<br> <a href='{event_url}'>Link</a>\"\n        ),\n    },\n    EVENT_IMPORT_FAIL: {\n        'recipient': 'User',\n        'subject': u'Import of event failed',\n        'message': (u\"The error was as follows - <br>\" + u\"<pre>{error_text}</pre>\"),\n    },\n    TEST_MAIL: {\n        'recipient': 'User',\n        'subject': u'Test Mail Subject',\n        'message': (u\"This is a  <strong> Test </strong> E-mail.\"),\n    },\n}\n", "path": "app/api/helpers/system_mails.py"}]}