fix: email

This commit is contained in:
Jannat Patel
2022-01-11 16:33:20 +05:30
parent e214573cd1
commit 62acdde68f
3 changed files with 8 additions and 7 deletions

View File

@@ -12,14 +12,15 @@ class JobOpportunity(Document):
@frappe.whitelist()
def report(job, reason):
system_managers = get_system_managers(only_name=True)
subject = _("User {0} has reported the job post {1}").format(user, job)
user = frappe.db.get_value("User", frappe.session.user, "full_name")
args = {
"job": job,
"job_url": get_link_to_form("Job Opportunity", job),
"user": frappe.session.user
"user": user,
"reason": reason
}
system_managers = get_system_managers(only_name=True)
user = frappe.db.get_value("User", frappe.session.user, "full_name")
subject = _("User {0} has reported the job post {1}").format(user, job)
frappe.sendmail(
recipients = system_managers,
subject=subject,

View File

@@ -1,7 +1,6 @@
{% set job_link = "<a href='" + job_url + "'>" + job + "</a>" %}
<p>{{ _("Hey,") }}</p>
<p>{{ _("{0} has reported a job post for the following reason.").format(user) }}</p>
<p>{{ reason }}</p>
<p>{{ _("Please take appropriate action at {0}").format(job_link) }}</p>
<p>{{ _("Please take appropriate action at {0}").format(job_url) }}</p>

View File

@@ -21,7 +21,8 @@ const report = (e) => {
"reason": $(".report-field").val()
},
callback: (data) => {
frappe.msgprint(__("Thanks for informing us about this post. Site admins will look into this and take an appropriate action soon."))
$(".report-modal").modal("hide");
frappe.msgprint(__("Thanks for informing us about this post. The Admins will look into this and take an appropriate action soon."))
}
})
}