Skip to content

Commit

Permalink
new send email options #200
Browse files Browse the repository at this point in the history
  • Loading branch information
connorkm2 authored Oct 15, 2024
1 parent aa99e63 commit e7e8c9d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
20 changes: 20 additions & 0 deletions functions/send_email/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
66 changes: 66 additions & 0 deletions functions/send_email/meal_body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="8fd711e6-aecf-4663-bf53-6607f08b57e9" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:30px 0px 40px 0px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
<div>
<div style="font-family: inherit; text-align: center">
<span style="color: #80817f; font-size: 12px">
<h1>Set your meal preferences!</h1>
</span>
</div>
<div style="font-family: inherit; text-align: center"><br></div>
<!-- <div style="font-family: inherit; text-align: center"><span style="color: #80817f; font-size: 24px"><strong></strong></span></div> -->
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="8fd711e6-aecf-4663-bf53-6607f08b57e9.1" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:0px 60px 60px 60px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="color: #80817f; font-size: 16px">
<p><strong>You have only got until $deadline_date!</strong></p><br />
<p>
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.
</p>
<br />
<p>
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.
</p>
<br />
<p>
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 <b>join a group</b> and we will try out best to sit you with the people in your group.
</p>
</span>
</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="module" data-role="module-button" data-type="button" role="module" style="table-layout:fixed;" width="100%" data-muid="0f986857-87df-4c0e-934f-e77105f78192">
<tbody>
<tr>
<td align="center" bgcolor="" class="outer-td" style="padding:0px 0px 0px 0px;">
<table border="0" cellpadding="0" cellspacing="0" class="wrapper-mobile" style="text-align:center;">
<tbody>
<tr>
<td align="center" bgcolor="#ffecea" class="inner-td" style="border-radius:6px; font-size:24px; text-align:center; background-color:inherit;">
<a href="$ticket_link" style="background-color:#2ED1FF; border:1px solid #2ED1FF; border-color:#2ED1FF; border-radius:6px; border-width:1px; color:#ffffff; display:inline-block; font-size:12px; font-weight:700; letter-spacing:0px; line-height:normal; padding:12px 40px 12px 40px; text-align:center; text-decoration:none; border-style:solid; font-family:inherit;" target="_blank">
<h1>MANAGE MY TICKET</h1>
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>

0 comments on commit e7e8c9d

Please sign in to comment.