Merge pull request #25614 from barredterra/translate-contact-msg
This commit is contained in:
commit
ffc45f287d
2 changed files with 15 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "templates/web.html" %}
|
||||
|
||||
{% set title = heading or "Contact Us" %}
|
||||
{% block header %}<h1>{{ heading or "Contact Us" }}</h1>{% endblock %}
|
||||
{% block header %}<h1>{{ heading or _("Contact Us") }}</h1>{% endblock %}
|
||||
|
||||
{% block page_content %}
|
||||
<style>
|
||||
|
|
@ -23,10 +23,10 @@
|
|||
<select name="subject" class="form-control">
|
||||
{% if query_options -%}
|
||||
{% for option in query_options.split("\n") -%}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
<option value="{{ option }}">{{ _(option) }}</option>
|
||||
{%- endfor %}
|
||||
{% else %}
|
||||
<option value="General">General</option>
|
||||
<option value="General">{{ _("General") }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -34,20 +34,29 @@ 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.
|
||||
|
||||
|
||||
Your query:
|
||||
|
||||
{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
|
||||
frappe.clear_last_message()
|
||||
|
||||
system_language = frappe.db.get_single_value("System Settings", "language")
|
||||
# add to to-do ?
|
||||
frappe.get_doc(
|
||||
doctype="Communication",
|
||||
sender=sender,
|
||||
subject=_("New Message from Website Contact Page"),
|
||||
subject=_("New Message from Website Contact Page", system_language),
|
||||
sent_or_received="Received",
|
||||
content=message,
|
||||
status="Open",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue