diff --git a/server/controllers/emails.py b/server/controllers/emails.py index 5297c68f8..3fe50eece 100644 --- a/server/controllers/emails.py +++ b/server/controllers/emails.py @@ -371,8 +371,11 @@ def send_email(): ).scalar() if not thread: return {"message": "Thread not found"}, 400 + + # replace
with \n in body + breaked_line_text = data["body"].replace("
", "\n") clean_regex = re.compile("<.*?>") - clean_text = re.sub(clean_regex, " ", data["body"]) + clean_text = re.sub(clean_regex, " ", breaked_line_text) context = {"body": data["body"]} template = env.get_template("template.html") body = template.render(**context)