Skip to content

Commit e5ad017

Browse files
committed
Fixed new line formatting in emails
1 parent 189302f commit e5ad017

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/controllers/emails.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,11 @@ def send_email():
371371
).scalar()
372372
if not thread:
373373
return {"message": "Thread not found"}, 400
374+
375+
# replace <br /> with \n in body
376+
breaked_line_text = data["body"].replace("<br/>", "\n")
374377
clean_regex = re.compile("<.*?>")
375-
clean_text = re.sub(clean_regex, " ", data["body"])
378+
clean_text = re.sub(clean_regex, " ", breaked_line_text)
376379
context = {"body": data["body"]}
377380
template = env.get_template("template.html")
378381
body = template.render(**context)

0 commit comments

Comments
 (0)