|
@@ -35,7 +35,7 @@ app.add_middleware(
|
|
|
)
|
|
|
|
|
|
|
|
|
-def hhh_send_mail(email):
|
|
|
+def hhh_send_mail(email,coffee=False):
|
|
|
SENDER = "Gorgeous Space <noreply@hhh.com.tw>"
|
|
|
RECIPIENT = "jeweiliang@gmail.com"
|
|
|
AWS_REGION = "us-east-1"
|
|
@@ -51,7 +51,11 @@ def hhh_send_mail(email):
|
|
|
msg["To"] = email
|
|
|
|
|
|
# Set message body
|
|
|
- body = MIMEText("感謝填寫幸福空間問卷,這是您的五萬元裝修折價券\n", "plain")
|
|
|
+ if coffee:
|
|
|
+ body = MIMEText("感謝填寫幸福空間問卷,開啟下方完整券樣(密碼9888)至櫃台掃碼兌換。https://txp.rs/v/EvX69b4Xq9 \n\n 附件是您的五萬元裝修折價券\n", "plain")
|
|
|
+ else:
|
|
|
+ body = MIMEText("感謝填寫幸福空間問卷,這是您的五萬元裝修折價券\n", "plain")
|
|
|
+
|
|
|
msg.attach(body)
|
|
|
|
|
|
filename = "coupon.png" # In same directory as script
|
|
@@ -149,7 +153,7 @@ async def line_submit(request: Request):
|
|
|
print(result)
|
|
|
get_db().insert(result)
|
|
|
# mail_to_user(email)
|
|
|
- x = threading.Thread(target=hhh_send_mail, args=(email,))
|
|
|
+ x = threading.Thread(target=hhh_send_mail, args=(email,coffee=True))
|
|
|
x.start()
|
|
|
|
|
|
return RedirectResponse(url="/a1/index_complete_line_after.html", status_code=HTTP_302_FOUND)
|