fix(email): Added diskription message to email
This commit is contained in:
1 parent
d10a5666ba
commit
9c59674158
2 files changed
+7
-2
No files matched your search
+5
-1
@@ -16,12 +16,16 @@ def post_email():
|
|||||||
name = data.get('name')
|
name = data.get('name')
|
||||||
phone = data.get('phone')
|
phone = data.get('phone')
|
||||||
email = data.get('email')
|
email = data.get('email')
|
||||||
|
message = data.get('message')
|
||||||
|
|
||||||
if not name or not phone or not email:
|
if not name or not phone or not email:
|
||||||
return jsonify({"error": "Missing required fields: name, phone, email"}), 400
|
return jsonify({"error": "Missing required fields: name, phone, email"}), 400
|
||||||
|
|
||||||
|
if not message:
|
||||||
|
message = "Не содержит текста заявки"
|
||||||
|
|
||||||
# Отправляем заявку на почту
|
# Отправляем заявку на почту
|
||||||
success = send_lead_to_email(name, phone, email)
|
success = send_lead_to_email(name, phone, email, message)
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
return jsonify({"status": "success", "message": "Lead sent successfully"}), 200
|
return jsonify({"status": "success", "message": "Lead sent successfully"}), 200
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,7 @@ from email.mime.text import MIMEText
|
|||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
|
|
||||||
|
|
||||||
def send_lead_to_email(name, phone, email):
|
def send_lead_to_email(name, phone, email, diskription):
|
||||||
"""
|
"""
|
||||||
Отправляет информацию о заявке на фиксированный email rkplastic@mail.ru.
|
Отправляет информацию о заявке на фиксированный email rkplastic@mail.ru.
|
||||||
|
|
||||||
@@ -35,6 +35,7 @@ def send_lead_to_email(name, phone, email):
|
|||||||
Имя: {name}
|
Имя: {name}
|
||||||
Телефон: {phone}
|
Телефон: {phone}
|
||||||
Почта: {email}
|
Почта: {email}
|
||||||
|
Содержание заявки: {diskription}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Создаём сообщение
|
# Создаём сообщение
|
||||||
|
|||||||
Reference in new issue
Block a user