Skip to content

Commit 0821a96

Browse files
committed
chore: add stuff for statutory
1 parent 9703205 commit 0821a96

9 files changed

+621
-2
lines changed

dispatcher/helpers/send.py

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
su_words_list = ['summer', 'awesome', 'your', 'now', 'sustainability', 'culture', 'europe', 'balkan', 'russia', 'adventure', 'ukraine', 'capital', 'montenegro', 'ireland', 'serbia', 'crimea', 'amazing', 'slavaukraini', 'heroiamslava']
2121
def su_sentence():
2222
return faker.sentence(nb_words=5, ext_word_list=su_words_list)
23-
# from constants.js
23+
def agora_sentence():
24+
return f"Agora {faker.sentence(nb_words=1)}"
25+
26+
# from constants.js (at least for core..)
2427
MAIL_SUBJECTS = {
2528
"CORE": {
2629
"MAIL_CONFIRMATION": 'MyAEGEE: Please confirm your account',
@@ -37,6 +40,15 @@ def su_sentence():
3740
"MAIL_EVENT_STATUS_CHANGED": "Your event's status was changed",
3841
"MAIL_EVENT_SUBMITTED": "An event was submitted",
3942
},
43+
"STATUTORY": {
44+
"MAIL_APPLIED": f"You've successfully applied for {agora_sentence()}",
45+
"MAIL_UPDATED": f"Your application for {agora_sentence()} was updated",
46+
"MAIL_APPLIED_BOARD": f"One of your body members has applied to {agora_sentence()}",
47+
"MAIL_UPDATED_BOARD": f"One of your body members has updated their application to {agora_sentence()}",
48+
"MAIL_CANDIDATE_APPLIED": "A new application was submitted",
49+
"MAIL_MEMBERSLIST_SUBMITTED": "The event was updated",
50+
"MAIL_MEMBERSLIST_EDITED": f"A memberslist has been edited for {agora_sentence()}",
51+
},
4052
"SUMMERUNIVERSITIES": {
4153
"MAIL_APPLIED_MEMBER": f"You've successfully applied for {su_sentence()}",
4254
"MAIL_APPLIED_ORGANISERS": f"Somebody has applied for {su_sentence()}",
@@ -70,6 +82,15 @@ def su_sentence():
7082
"MAIL_EVENT_STATUS_CHANGED": "events_status_changed",
7183
"MAIL_EVENT_SUBMITTED": "events_submitted",
7284
},
85+
"STATUTORY": {
86+
"MAIL_APPLIED": "statutory_applied",
87+
"MAIL_UPDATED": "statutory_edited",
88+
"MAIL_APPLIED_BOARD": "statutory_board_applied",
89+
"MAIL_UPDATED_BOARD": "statutory_board_edited",
90+
"MAIL_CANDIDATE_APPLIED": "candidate_applied",
91+
"MAIL_MEMBERSLIST_SUBMITTED": "statutory_memberslist_submitted",
92+
"MAIL_MEMBERSLIST_EDITED": "statutory_memberslist_edited",
93+
},
7394
"SUMMERUNIVERSITIES": {
7495
"MAIL_APPLIED_MEMBER": "summeruniversity_applied",
7596
"MAIL_APPLIED_ORGANISERS": "summeruniversity_organizer_applied",
@@ -85,7 +106,7 @@ def su_sentence():
85106
},
86107
}
87108

88-
RABBIT_HOST='172.18.0.8' #FIXME
109+
RABBIT_HOST='172.18.0.5' #FIXME
89110
connection = pika.BlockingConnection(pika.ConnectionParameters(RABBIT_HOST))
90111
channel = connection.channel()
91112

@@ -114,6 +135,8 @@ def generate_fake_payload(subj="", template=""):
114135
"place": faker.city(),
115136
"token": faker.md5(),
116137
"old_status": "snafu",
138+
"event_name": agora_sentence(),
139+
"membership_fee": "15⎊",
117140
"event": {
118141
"name": su_sentence(),
119142
"location": faker.city(),
@@ -135,11 +158,26 @@ def generate_fake_payload(subj="", template=""):
135158
"motivation": "I wanna suck",
136159
"status": "totally snafu",
137160
"email": "[email protected]",
161+
"gender": "Robot",
162+
"date_of_birth": "1985-04-16",
163+
"nationality": "Europe",
164+
"meals": "Steak",
165+
"allergies": "wallopers",
166+
"number_of_events_visited": "over 9000",
167+
"visa_required": "No",
138168
"answers": [
139169
"ho-hoo, ho-hoo",
140170
"42",
141171
],
142172
},
173+
"candidate": {
174+
"first_name": faker.first_name(),
175+
"last_name": faker.last_name(),
176+
},
177+
"position": {
178+
"event_id": "42",
179+
"name": "This gran C commissioner",
180+
},
143181
}
144182
}
145183
return email
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
5+
{% import "snippets/macros.jinja2" as macros %}
6+
{{ macros.head("MyAEGEE: New candidature submitted") }}
7+
8+
<body style="width:100% !important;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;">
9+
<table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" style="margin:0; padding:0; width:100% !important; line-height: 100% !important; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;background-color: #F9FAFB;"
10+
width="100%">
11+
<tbody>
12+
<tr>
13+
<td width="10" valign="top">&nbsp;</td>
14+
<td valign="top" align="center">
15+
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width: 100%; max-width: 600px; background-color: #FFF; border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt;"
16+
id="contentTable">
17+
<tbody>
18+
<tr>
19+
<td width="600" valign="top" align="center" style="border-collapse:collapse;">
20+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background: #F9FAFB;" width="100%">
21+
<tbody>
22+
<tr>
23+
<td align="center" valign="top">
24+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;">&nbsp;</div>
25+
</td>
26+
</tr>
27+
</tbody>
28+
</table>
29+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #E0E4E8;"
30+
width="100%">
31+
<tbody>
32+
<tr>
33+
<td align="center" style="padding: 56px 56px 28px 56px;" valign="top">
34+
<a style="color: #3498DB; text-decoration: none;" href="my.aegee.eu"
35+
target="_blank"><img style="width: 56px; height: 56px; border: 0;" alt="Logo"
36+
src="https://my.aegee.eu/images/logo.png">
37+
</a></td>
38+
</tr>
39+
<tr>
40+
<td align="center" style="padding: 0 56px 28px 56px;" valign="top">
41+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 20px; color: #333;"><strong>A new candidature is submitted</strong></div>
42+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 16px; color: #333;">
43+
A new candidature to position
44+
<strong>{{ position["name"] }}</strong>
45+
is submitted by
46+
<strong>{{ candidate["first_name"] }} {{candidate["last_name"] }}</strong>.
47+
</div>
48+
</td>
49+
</tr>
50+
<tr>
51+
<td align="center" style="padding: 0 56px 28px 56px;" valign="top">
52+
<div>
53+
<a href="https://my.aegee.eu/statutory/{{ position["event_id"] }}/positions/all" style="background-color:#1468C5;border-radius:50px;color:#ffffff;display:inline-block;font-family: 'lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:18px;font-weight: bold;line-height:40px;text-align:center;text-decoration:none;width:270px;-webkit-text-size-adjust:none;"
54+
target="_blank">View candidatures</a>
55+
</div>
56+
</td>
57+
</tr>
58+
</tbody>
59+
</table>
60+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background: #F9FAFB;" width="100%">
61+
<tbody>
62+
<tr>
63+
<td align="center" style="padding: 28px 56px;" valign="top">
64+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 16px; line-height: 24px; color: #A7ADB5;">This email was autogenerated by MyAEGEE mailer.</div>
65+
</td>
66+
</tr>
67+
</tbody>
68+
</table>
69+
</td>
70+
</tr>
71+
</tbody>
72+
</table>
73+
</td>
74+
</tr>
75+
</tbody>
76+
</table>
77+
78+
79+
80+
</body>
81+
82+
</html>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<ul>
2+
<li><strong>Body name: </strong>{{ application["body_name"] }}</li>
3+
<li><strong>Applied on: </strong>{{ application["created_at"] }}</li>
4+
<li><strong>Updated on: </strong>{{ application["updated_at"] }}</li>
5+
<li><strong>First name: </strong>{{ application["first_name"] }}</li>
6+
<li><strong>Last name: </strong>{{ application["last_name"] }}</li>
7+
<li><strong>Gender: </strong>{{ application["gender"] }}</li>
8+
<li><strong>Date of birth: </strong>{{ application["date_of_birth"] }}</li>
9+
<li><strong>Email: </strong>{{ application["email"] }}</li>
10+
<li><strong>Nationality: </strong>{{ application["nationality"] }}</li>
11+
<li><strong>Meals: </strong>{{ application["meals"] }}</li>
12+
<li><strong>Allergies: </strong>{{ application["allergies"] }}</li>
13+
<li><strong>Number of events visited: </strong>{{ application["number_of_events_visited"] }}</li>
14+
<li><strong>Visa required?: </strong>{{ application["visa_required"] }}</li>
15+
<li><strong>Visa passport number: </strong>{{ application["visa_passport_number"] }}</li>
16+
<li><strong>Visa passport issue date: </strong>{{ application["visa_passport_issue_date"] }}</li>
17+
<li><strong>Visa passport expiration date: </strong>{{ application["visa_passport_expiration_date"] }}</li>
18+
<li><strong>Visa passport issue authority: </strong>{{ application["visa_passport_issue_authority"] }}</li>
19+
<li><strong>Place of birth: </strong>{{ application["visa_place_of_birth"] }}</li>
20+
<li><strong>Street and house number: </strong>{{ application["visa_street_and_house"] }}</li>
21+
<li><strong>Postal code: </strong>{{ application["visa_postal_code"] }}</li>
22+
<li><strong>City: </strong>{{ application["visa_city"] }}</li>
23+
<li><strong>Country: </strong>{{ application["visa_country"] }}</li>
24+
<li><strong>Embassy: </strong>{{ application["visa_embassy"] }}</li>
25+
26+
{% for question in event["questions"] %}
27+
<li><strong>{{ question["description"] }} </strong> {{ application["answers"][loop.index0] }}</li>
28+
{% endfor %}
29+
30+
</ul>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
5+
{% import "snippets/macros.jinja2" as macros %}
6+
{{ macros.head("MyAEGEE: Your application for VAR"|replace("VAR", event["name"])) }}
7+
8+
<body style="width:100% !important;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;">
9+
<table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" style="margin:0; padding:0; width:100% !important; line-height: 100% !important; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;background-color: #F9FAFB;"
10+
width="100%">
11+
<tbody>
12+
<tr>
13+
<td width="10" valign="top">&nbsp;</td>
14+
<td valign="top" align="center">
15+
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width: 100%; max-width: 600px; background-color: #FFF; border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt;"
16+
id="contentTable">
17+
<tbody>
18+
<tr>
19+
<td width="600" valign="top" align="center" style="border-collapse:collapse;">
20+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background: #F9FAFB;" width="100%">
21+
<tbody>
22+
<tr>
23+
<td align="center" valign="top">
24+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;">&nbsp;</div>
25+
</td>
26+
</tr>
27+
</tbody>
28+
</table>
29+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #E0E4E8;"
30+
width="100%">
31+
<tbody>
32+
<tr>
33+
<td align="center" style="padding: 56px 56px 28px 56px;" valign="top">
34+
<a style="color: #3498DB; text-decoration: none;" href="my.aegee.eu"
35+
target="_blank"><img style="width: 56px; height: 56px; border: 0;" alt="AEGEE-Europe"
36+
src="https://my.aegee.eu/images/logo.png">
37+
</a></td>
38+
</tr>
39+
<tr>
40+
<td align="center" style="padding: 0 56px 28px 56px;" valign="top">
41+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 20px; color: #333;"><strong>You've successfully applied to {{ event["name"] }}</strong></div>
42+
</td>
43+
</tr>
44+
<tr>
45+
<td style="padding: 0 56px 28px 56px;" valign="top">
46+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 16px; color: #333;">
47+
Here are your application details:
48+
{% include "snippets/statutory_application_info.jinja2" %}
49+
</div>
50+
</td>
51+
</tr>
52+
<tr>
53+
<td style="padding: 0 56px 28px 56px;" valign="top">
54+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 16px; color: #333;">
55+
Have you already subscribed to our internal communication channels? Don’t miss out on any AEGEE news or announcements, subscribe to <a href="https://my.aegee.eu/pages/mailing-lists">our mailing lists</a>!
56+
</div>
57+
</td>
58+
</tr>
59+
</tbody>
60+
</table>
61+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background: #F9FAFB;" width="100%">
62+
<tbody>
63+
<tr>
64+
<td align="center" style="padding: 28px 56px;" valign="top">
65+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 16px; line-height: 24px; color: #A7ADB5;">This email was autogenerated by MyAEGEE mailer.</div>
66+
</td>
67+
</tr>
68+
</tbody>
69+
</table>
70+
</td>
71+
</tr>
72+
</tbody>
73+
</table>
74+
</td>
75+
</tr>
76+
</tbody>
77+
</table>
78+
79+
80+
81+
</body>
82+
83+
</html>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
5+
{% import "snippets/macros.jinja2" as macros %}
6+
{{ macros.head("MyAEGEE: A member of your body applied for VAR"|replace("VAR", event["name"])) }}
7+
8+
<body style="width:100% !important;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;">
9+
<table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" style="margin:0; padding:0; width:100% !important; line-height: 100% !important; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;background-color: #F9FAFB;"
10+
width="100%">
11+
<tbody>
12+
<tr>
13+
<td width="10" valign="top">&nbsp;</td>
14+
<td valign="top" align="center">
15+
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width: 100%; max-width: 600px; background-color: #FFF; border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt;"
16+
id="contentTable">
17+
<tbody>
18+
<tr>
19+
<td width="600" valign="top" align="center" style="border-collapse:collapse;">
20+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background: #F9FAFB;" width="100%">
21+
<tbody>
22+
<tr>
23+
<td align="center" valign="top">
24+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;">&nbsp;</div>
25+
</td>
26+
</tr>
27+
</tbody>
28+
</table>
29+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #E0E4E8;"
30+
width="100%">
31+
<tbody>
32+
<tr>
33+
<td align="center" style="padding: 56px 56px 28px 56px;" valign="top">
34+
<a style="color: #3498DB; text-decoration: none;" href="my.aegee.eu"
35+
target="_blank"><img style="width: 56px; height: 56px; border: 0;"
36+
src="https://my.aegee.eu/images/logo.png">
37+
</a></td>
38+
</tr>
39+
<tr>
40+
<td align="center" style="padding: 0 56px 28px 56px;" valign="top">
41+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 20px; color: #333;"><strong>A member of your body ({{ application["body_name"] }}) applied for {{ event["name"] }}</strong></div>
42+
</td>
43+
</tr>
44+
<tr>
45+
<td style="padding: 0 56px 28px 56px;" valign="top">
46+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 16px; color: #333;">
47+
Here are the application details:
48+
{% include "snippets/statutory_application_info.jinja2" %}
49+
</div>
50+
</td>
51+
</tr>
52+
<tr>
53+
<td align="center" style="padding: 0 56px 28px 56px;" valign="top">
54+
<div>
55+
<a href="https://my.aegee.eu/statutory/{{ event["url"] }}/boardview" style="background-color:#1468C5;border-radius:50px;color:#ffffff;display:inline-block;font-family: 'lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:18px;font-weight: bold;line-height:40px;text-align:center;text-decoration:none;width:270px;-webkit-text-size-adjust:none;"
56+
target="_blank">Manage boardview</a>
57+
</div>
58+
</td>
59+
</tr>
60+
</tbody>
61+
</table>
62+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background: #F9FAFB;" width="100%">
63+
<tbody>
64+
<tr>
65+
<td align="center" style="padding: 28px 56px;" valign="top">
66+
<div style="font-family: &quot;lato&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; line-height: 28px;font-size: 16px; line-height: 24px; color: #A7ADB5;">This email was autogenerated by MyAEGEE mailer.</div>
67+
</td>
68+
</tr>
69+
</tbody>
70+
</table>
71+
</td>
72+
</tr>
73+
</tbody>
74+
</table>
75+
</td>
76+
</tr>
77+
</tbody>
78+
</table>
79+
80+
81+
82+
</body>
83+
84+
</html>

0 commit comments

Comments
 (0)