fix: email
This commit is contained in:
@@ -12,14 +12,15 @@ class JobOpportunity(Document):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def report(job, reason):
|
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 = {
|
args = {
|
||||||
"job": job,
|
"job": job,
|
||||||
"job_url": get_link_to_form("Job Opportunity", 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(
|
frappe.sendmail(
|
||||||
recipients = system_managers,
|
recipients = system_managers,
|
||||||
subject=subject,
|
subject=subject,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{% set job_link = "<a href='" + job_url + "'>" + job + "</a>" %}
|
{% set job_link = "<a href='" + job_url + "'>" + job + "</a>" %}
|
||||||
|
|
||||||
|
|
||||||
<p>{{ _("Hey,") }}</p>
|
<p>{{ _("Hey,") }}</p>
|
||||||
<p>{{ _("{0} has reported a job post for the following reason.").format(user) }}</p>
|
<p>{{ _("{0} has reported a job post for the following reason.").format(user) }}</p>
|
||||||
<p>{{ reason }}</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>
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ const report = (e) => {
|
|||||||
"reason": $(".report-field").val()
|
"reason": $(".report-field").val()
|
||||||
},
|
},
|
||||||
callback: (data) => {
|
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."))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user