diff --git a/src/templates/confirmed_rdv.html b/src/templates/confirmed_rdv.html new file mode 100644 index 0000000..d1e052b --- /dev/null +++ b/src/templates/confirmed_rdv.html @@ -0,0 +1,164 @@ + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Dear Madam / Dear + Sir, +
We are pleased to + confirm your appointment. +
You will be welcomed + on Dec 10, 2022 in our store at 42 avenue George V at 5:25 + PM. +
The given hour might + be subject to change. Please kindly follow up on your + appointment status on https://rendezvousparis.hermes.com/client/XARMBP +
As your appointment + approaches, we invite you to introduce yourself to one of + our receptionists. +
Please bring the + proof of identity used on our website. +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/utils/send_email_mailjet.py b/src/utils/send_email_mailjet.py new file mode 100644 index 0000000..7a91ca7 --- /dev/null +++ b/src/utils/send_email_mailjet.py @@ -0,0 +1,40 @@ +""" +Run: +""" +from mailjet_rest import Client + +from src import config + +api_key = "489274f04d5c155f81370fccc3904e20" +api_secret = "edac41f0e1726ba49808dfb12204ecd6" +mailjet = Client(auth=(api_key, api_secret), version='v3.1') +from_email = "panleicim@gmail.com" +# store = "Hermès Paris Faubourg" +store = "Hermès Paris George V" +dest_email = "panleicim@gmail.com" +contact_name = "LUO Meiling" + +f = open(config.ROOT_DIR + "/templates/confirmed_rdv.html", "r") +email_body = f.read() +print(email_body) +data = { + 'Messages': [ + { + "From": { + "Email": from_email, + "Name": store + }, + "To": [ + { + "Email": dest_email, + "Name": contact_name + } + ], + "Subject": "Your appointment is confirmed!", + "HTMLPart": email_body + } + ] +} +result = mailjet.send.create(data=data) +print(result.status_code) +print(result.json())