41 lines
986 B
Python
41 lines
986 B
Python
"""
|
|
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 = "928490803@qq.com"
|
|
contact_name = "LAI zhixiang"
|
|
|
|
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())
|