diff --git a/dispatcher/helpers/send.py b/dispatcher/helpers/send.py index 5e7baf19..f4fcd5b8 100644 --- a/dispatcher/helpers/send.py +++ b/dispatcher/helpers/send.py @@ -20,7 +20,10 @@ su_words_list = ['summer', 'awesome', 'your', 'now', 'sustainability', 'culture', 'europe', 'balkan', 'russia', 'adventure', 'ukraine', 'capital', 'montenegro', 'ireland', 'serbia', 'crimea', 'amazing', 'slavaukraini', 'heroiamslava'] def su_sentence(): return faker.sentence(nb_words=5, ext_word_list=su_words_list) -# from constants.js +def agora_sentence(): + return f"Agora {faker.sentence(nb_words=1)}" + +# from constants.js (at least for core..) MAIL_SUBJECTS = { "CORE": { "MAIL_CONFIRMATION": 'MyAEGEE: Please confirm your account', @@ -37,6 +40,15 @@ def su_sentence(): "MAIL_EVENT_STATUS_CHANGED": "Your event's status was changed", "MAIL_EVENT_SUBMITTED": "An event was submitted", }, + "STATUTORY": { + "MAIL_APPLIED": f"You've successfully applied for {agora_sentence()}", + "MAIL_UPDATED": f"Your application for {agora_sentence()} was updated", + "MAIL_APPLIED_BOARD": f"One of your body members has applied to {agora_sentence()}", + "MAIL_UPDATED_BOARD": f"One of your body members has updated their application to {agora_sentence()}", + "MAIL_CANDIDATE_APPLIED": "A new application was submitted", + "MAIL_MEMBERSLIST_SUBMITTED": "The event was updated", + "MAIL_MEMBERSLIST_EDITED": f"A memberslist has been edited for {agora_sentence()}", + }, "SUMMERUNIVERSITIES": { "MAIL_APPLIED_MEMBER": f"You've successfully applied for {su_sentence()}", "MAIL_APPLIED_ORGANISERS": f"Somebody has applied for {su_sentence()}", @@ -70,6 +82,15 @@ def su_sentence(): "MAIL_EVENT_STATUS_CHANGED": "events_status_changed", "MAIL_EVENT_SUBMITTED": "events_submitted", }, + "STATUTORY": { + "MAIL_APPLIED": "statutory_applied", + "MAIL_UPDATED": "statutory_edited", + "MAIL_APPLIED_BOARD": "statutory_board_applied", + "MAIL_UPDATED_BOARD": "statutory_board_edited", + "MAIL_CANDIDATE_APPLIED": "candidate_applied", + "MAIL_MEMBERSLIST_SUBMITTED": "statutory_memberslist_submitted", + "MAIL_MEMBERSLIST_EDITED": "statutory_memberslist_edited", + }, "SUMMERUNIVERSITIES": { "MAIL_APPLIED_MEMBER": "summeruniversity_applied", "MAIL_APPLIED_ORGANISERS": "summeruniversity_organizer_applied", @@ -85,7 +106,7 @@ def su_sentence(): }, } -RABBIT_HOST='172.18.0.8' #FIXME +RABBIT_HOST='172.18.0.5' #FIXME connection = pika.BlockingConnection(pika.ConnectionParameters(RABBIT_HOST)) channel = connection.channel() @@ -114,6 +135,8 @@ def generate_fake_payload(subj="", template=""): "place": faker.city(), "token": faker.md5(), "old_status": "snafu", + "event_name": agora_sentence(), + "membership_fee": "15⎊", "event": { "name": su_sentence(), "location": faker.city(), @@ -135,11 +158,26 @@ def generate_fake_payload(subj="", template=""): "motivation": "I wanna suck", "status": "totally snafu", "email": "someone@example.org", + "gender": "Robot", + "date_of_birth": "1985-04-16", + "nationality": "Europe", + "meals": "Steak", + "allergies": "wallopers", + "number_of_events_visited": "over 9000", + "visa_required": "No", "answers": [ "ho-hoo, ho-hoo", "42", ], }, + "candidate": { + "first_name": faker.first_name(), + "last_name": faker.last_name(), + }, + "position": { + "event_id": "42", + "name": "This gran C commissioner", + }, } } return email diff --git a/dispatcher/templates/candidate_applied.jinja2 b/dispatcher/templates/candidate_applied.jinja2 new file mode 100644 index 00000000..e2c92d07 --- /dev/null +++ b/dispatcher/templates/candidate_applied.jinja2 @@ -0,0 +1,82 @@ + + + + +{% import "snippets/macros.jinja2" as macros %} +{{ macros.head("MyAEGEE: New candidature submitted") }} + + + + + + + + + +
  + + + + + + +
+ + + + + + +
+
 
+
+ + + + + + + + + + + + +
+ Logo +
+
A new candidature is submitted
+
+ A new candidature to position + {{ position["name"] }} + is submitted by + {{ candidate["first_name"] }} {{candidate["last_name"] }}. +
+
+ +
+ + + + + + +
+
This email was autogenerated by MyAEGEE mailer.
+
+
+
+ + + + + + diff --git a/dispatcher/templates/statutory_applied.jinja2 b/dispatcher/templates/statutory_applied.jinja2 new file mode 100644 index 00000000..9c754e9c --- /dev/null +++ b/dispatcher/templates/statutory_applied.jinja2 @@ -0,0 +1,83 @@ + + + + +{% import "snippets/macros.jinja2" as macros %} +{{ macros.head("MyAEGEE: Your application for VAR"|replace("VAR", event["name"])) }} + + + + + + + + + +
  + + + + + + +
+ + + + + + +
+
 
+
+ + + + + + + + + + + + + + + +
+ AEGEE-Europe +
+
You've successfully applied to {{ event["name"] }}
+
+
+ Here are your application details: + {% include "snippets/statutory_application_info.jinja2" %} +
+
+
+ Have you already subscribed to our internal communication channels? Don’t miss out on any AEGEE news or announcements, subscribe to our mailing lists! +
+
+ + + + + + +
+
This email was autogenerated by MyAEGEE mailer.
+
+
+
+ + + + + + diff --git a/dispatcher/templates/statutory_board_applied.jinja2 b/dispatcher/templates/statutory_board_applied.jinja2 new file mode 100644 index 00000000..095ac010 --- /dev/null +++ b/dispatcher/templates/statutory_board_applied.jinja2 @@ -0,0 +1,84 @@ + + + + +{% import "snippets/macros.jinja2" as macros %} +{{ macros.head("MyAEGEE: A member of your body applied for VAR"|replace("VAR", event["name"])) }} + + + + + + + + + +
  + + + + + + +
+ + + + + + +
+
 
+
+ + + + + + + + + + + + + + + +
+ +
+
A member of your body ({{ application["body_name"] }}) applied for {{ event["name"] }}
+
+
+ Here are the application details: + {% include "snippets/statutory_application_info.jinja2" %} +
+
+ +
+ + + + + + +
+
This email was autogenerated by MyAEGEE mailer.
+
+
+
+ + + + + + diff --git a/dispatcher/templates/statutory_board_edited.jinja2 b/dispatcher/templates/statutory_board_edited.jinja2 new file mode 100644 index 00000000..12312b98 --- /dev/null +++ b/dispatcher/templates/statutory_board_edited.jinja2 @@ -0,0 +1,84 @@ + + + + +{% import "snippets/macros.jinja2" as macros %} +{{ macros.head("MyAEGEE: A member of your body edited the application for VAR"|replace("VAR", event["name"])) }} + + + + + + + + + +
  + + + + + + +
+ + + + + + +
+
 
+
+ + + + + + + + + + + + + + + +
+ +
+
A member of your body ({{ application["body_name"] }}) edited the application for {{ event["name"] }}
+
+
+ Here are the application details: + {% include "snippets/statutory_application_info.jinja2" %} +
+
+ +
+ + + + + + +
+
This email was autogenerated by MyAEGEE mailer.
+
+
+
+ + + + + + diff --git a/dispatcher/templates/statutory_edited.jinja2 b/dispatcher/templates/statutory_edited.jinja2 new file mode 100644 index 00000000..31fbf47b --- /dev/null +++ b/dispatcher/templates/statutory_edited.jinja2 @@ -0,0 +1,76 @@ + + + + +{% import "snippets/macros.jinja2" as macros %} +{{ macros.head("MyAEGEE: Your application for VAR"|replace("VAR", event["name"])) }} + + + + + + + + + +
  + + + + + + +
+ + + + + + +
+
 
+
+ + + + + + + + + + + + +
+ AEGEE-Europe +
+
Your application for {{ event["name"] }} was successfully updated.
+
+
+ Here are your application details: + {% include "snippets/statutory_application_info.jinja2" %} +
+
+ + + + + + +
+
This email was autogenerated by MyAEGEE mailer.
+
+
+
+ + + + + + diff --git a/dispatcher/templates/statutory_memberslist_edited.jinja2 b/dispatcher/templates/statutory_memberslist_edited.jinja2 new file mode 100644 index 00000000..0ab859d1 --- /dev/null +++ b/dispatcher/templates/statutory_memberslist_edited.jinja2 @@ -0,0 +1,71 @@ + + + + +{% import "snippets/macros.jinja2" as macros %} +{{ macros.head("MyAEGEE: A memberslist has been edited for VAR"|replace("VAR", event_name)) }} + + + + + + + + + +
  + + + + + + +
+ + + + + + +
+
 
+
+ + + + + + + + + +
+ Logo +
+
+ "{{ body_name }}" has edited their memberslist for "{{ event_name }}". + Their new membership fee is "{{ membership_fee }}". +
+
+ + + + + + +
+
This email was autogenerated by MyAEGEE mailer.
+
+
+
+ + + + + + diff --git a/dispatcher/templates/statutory_memberslist_submitted.jinja2 b/dispatcher/templates/statutory_memberslist_submitted.jinja2 new file mode 100644 index 00000000..7dfd0d3e --- /dev/null +++ b/dispatcher/templates/statutory_memberslist_submitted.jinja2 @@ -0,0 +1,71 @@ + + + + +{% import "snippets/macros.jinja2" as macros %} +{{ macros.head("MyAEGEE: A memberslist has been submitted for VAR"|replace("VAR", event_name)) }} + + + + + + + + + +
  + + + + + + +
+ + + + + + +
+
 
+
+ + + + + + + + + +
+ Logo +
+
+ "{{ body_name }}" has submitted their memberslist for "{{ event_name }}". + Their membership fee is "{{ membership_fee }}". +
+
+ + + + + + +
+
This email was autogenerated by MyAEGEE mailer.
+
+
+
+ + + + + +