Skip to content

Commit

Permalink
fix(Contact form): make email translatable
Browse files Browse the repository at this point in the history
(cherry picked from commit bcdce09)
  • Loading branch information
barredterra authored and mergify[bot] committed Mar 22, 2024
1 parent 7699f12 commit 1a794df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frappe/www/contact.py
Expand Up @@ -34,10 +34,13 @@ def send_message(sender, message, subject="Website Query"):
if forward_to_email := frappe.db.get_single_value("Contact Us Settings", "forward_to_email"):
frappe.sendmail(recipients=forward_to_email, reply_to=sender, content=message, subject=subject)

reply = _(
"Thank you for reaching out to us. We will get back to you at the earliest.\n\n\nYour query:\n\n{0}"
).format(message)
frappe.sendmail(
recipients=sender,
content=f"<div style='white-space: pre-wrap'>Thank you for reaching out to us. We will get back to you at the earliest.\n\n\nYour query:\n\n{message}</div>",
subject="We've received your query!",
content=f"<div style='white-space: pre-wrap'>{reply}</div>",
subject=_("We've received your query!"),
)

# for clearing outgoing email error message
Expand Down

0 comments on commit 1a794df

Please sign in to comment.