From e7e8c9d2da2dc41eb66cd9d03f9368cb1d1fa72e Mon Sep 17 00:00:00 2001 From: Connor Monaghan Date: Tue, 15 Oct 2024 22:18:07 +0200 Subject: [PATCH] new send email options #200 --- functions/send_email/lambda_function.py | 20 ++++++++ functions/send_email/meal_body.html | 66 +++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 functions/send_email/meal_body.html diff --git a/functions/send_email/lambda_function.py b/functions/send_email/lambda_function.py index c505e74b..993596d6 100644 --- a/functions/send_email/lambda_function.py +++ b/functions/send_email/lambda_function.py @@ -133,6 +133,26 @@ def lambda_handler(event, context): subject = "Merseyside Latin Festival Group Recommendation" attachment = None + elif event['email_type'] == "meal_reminder": + if 'subject' in event: + subject = event['subject'] + else: + subject = "MLF - Choose Your Meal" + + deadline_date = "2nd November" + with open("./send_email/meal_body.html", "r") as body_file: + body_tmpl = Template(body_file.read()) + subdomain = "www" if os.environ.get("STAGE_NAME") == "prod" else os.environ.get("STAGE_NAME") + body = body_tmpl.substitute({ + 'deanline_date':deadline_date, + 'ticket_link':"http://{}.merseysidelatinfestival.co.uk/preferences?email={}&ticket_number={}".format(subdomain, event['email'], event['ticket_number']), + }) + attachment = None + elif event['email_type'] == "basic_message": + body = event['message_body'] + subject = event['subject'] + attachment = None + else: return False diff --git a/functions/send_email/meal_body.html b/functions/send_email/meal_body.html new file mode 100644 index 00000000..3a685b81 --- /dev/null +++ b/functions/send_email/meal_body.html @@ -0,0 +1,66 @@ + + + + + + +
+
+
+ +

Set your meal preferences!

+
+
+

+ +
+
+
+ + + + + + +
+
+
+ +

You have only got until $deadline_date!


+

+ We are so excited to welcome you to our Gala Dinner on Saturday 30th November at Merseyside Latin Festival. + It will be an unforgettable evening with great food and even better dance moves. + Take a quick moment to select your meal options now. +

+
+

+ You can modify your options up until the $deadline_date, after this date you can no longer select options and it will be set to the default option. + If you have purchased multiple tickets with dinner included you will need to select the options for each ticket. +

+
+

+ To manage your ticket click the link below and you will be able to select your meal options. + If you have a table preference you can join a group and we will try out best to sit you with the people in your group. +

+
+
+
+ + + + + + +
+ + + + + + +
+ +

MANAGE MY TICKET

+
+
+
\ No newline at end of file