Skip to content

Commit ad22590

Browse files
committed
Fixed the new line formatting issue
1 parent 5e3d3ee commit ad22590

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/controllers/emails.py

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

0 commit comments

Comments
 (0)