Merge pull request #1378 from pateljannat/issues-83
fix: batch reminder email subject and content
This commit is contained in:
@@ -1,6 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<Button
|
||||||
|
v-if="certification.data && certification.data.certificate"
|
||||||
|
@click="downloadCertificate"
|
||||||
|
class="w-full"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<GraduationCap class="size-4 stroke-1.5" />
|
||||||
|
</template>
|
||||||
|
{{ __('View Certificate') }}
|
||||||
|
</Button>
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-else-if="
|
||||||
certification.data &&
|
certification.data &&
|
||||||
certification.data.membership &&
|
certification.data.membership &&
|
||||||
certification.data.paid_certificate &&
|
certification.data.paid_certificate &&
|
||||||
@@ -25,7 +35,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
v-else-if="!certification.data.membership.certficate"
|
v-else-if="!certification.data.membership.certificate"
|
||||||
:to="{
|
:to="{
|
||||||
name: 'CourseCertification',
|
name: 'CourseCertification',
|
||||||
params: {
|
params: {
|
||||||
@@ -64,4 +74,12 @@ const certification = createResource({
|
|||||||
auto: true,
|
auto: true,
|
||||||
cache: ['certificationData', user.data?.name],
|
cache: ['certificationData', user.data?.name],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const downloadCertificate = () => {
|
||||||
|
window.open(
|
||||||
|
`/api/method/frappe.utils.print_format.download_pdf?doctype=LMS+Certificate&name=${
|
||||||
|
certification.data.certificate.name
|
||||||
|
}&format=${encodeURIComponent(certification.data.certificate.template)}`
|
||||||
|
)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1295,13 +1295,23 @@ def get_certification_details(course):
|
|||||||
membership = frappe.db.get_value(
|
membership = frappe.db.get_value(
|
||||||
"LMS Enrollment",
|
"LMS Enrollment",
|
||||||
filters,
|
filters,
|
||||||
["name", "certificate", "purchased_certificate"],
|
["name", "purchased_certificate"],
|
||||||
as_dict=1,
|
as_dict=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
paid_certificate = frappe.db.get_value("LMS Course", course, "paid_certificate")
|
paid_certificate = frappe.db.get_value("LMS Course", course, "paid_certificate")
|
||||||
|
certificate = frappe.db.get_value(
|
||||||
|
"LMS Certificate",
|
||||||
|
{"member": frappe.session.user, "course": course},
|
||||||
|
["name", "template"],
|
||||||
|
as_dict=1,
|
||||||
|
)
|
||||||
|
|
||||||
return {"membership": membership, "paid_certificate": paid_certificate}
|
return {
|
||||||
|
"membership": membership,
|
||||||
|
"paid_certificate": paid_certificate,
|
||||||
|
"certificate": certificate,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
@@ -408,14 +408,14 @@ def send_batch_start_reminder():
|
|||||||
|
|
||||||
for batch in batches:
|
for batch in batches:
|
||||||
students = frappe.get_all(
|
students = frappe.get_all(
|
||||||
"LMS Batch Enrollment", {"batch": batch}, ["member", "member_name"]
|
"LMS Batch Enrollment", {"batch": batch.name}, ["member", "member_name"]
|
||||||
)
|
)
|
||||||
for student in students:
|
for student in students:
|
||||||
send_mail(batch, student)
|
send_mail(batch, student)
|
||||||
|
|
||||||
|
|
||||||
def send_mail(batch, student):
|
def send_mail(batch, student):
|
||||||
subject = _("Batch Start Reminder")
|
subject = _("Your batch {0} is starting tomorrow").format(batch.title)
|
||||||
template = "batch_start_reminder"
|
template = "batch_start_reminder"
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ def send_live_class_reminder():
|
|||||||
|
|
||||||
|
|
||||||
def send_mail(live_class, student):
|
def send_mail(live_class, student):
|
||||||
subject = f"Your class on {live_class.title} is tomorrow"
|
subject = _("Your class on {0} is today").format(live_class.title)
|
||||||
template = "live_class_reminder"
|
template = "live_class_reminder"
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
|
|||||||
@@ -9,23 +9,20 @@
|
|||||||
<p>
|
<p>
|
||||||
<b>{{ _("Batch:") }}</b> {{ title }}
|
<b>{{ _("Batch:") }}</b> {{ title }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
|
||||||
<p>
|
<p>
|
||||||
<b>{{ _("Start Date:") }}</b> {{ frappe.utils.format_date(start_date, "medium") }}
|
<b>{{ _("Start Date:") }}</b> {{ frappe.utils.format_date(start_date, "long") }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
|
||||||
<p>
|
<p>
|
||||||
<b>{{ _("Timings:") }}</b> {{ frappe.utils.format_time(start_time, "hh:mm a") }}
|
<b>{{ _("Timings:") }}</b> {{ frappe.utils.format_time(start_time, "hh:mm a") }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
|
||||||
<p>
|
<p>
|
||||||
<b>{{ _("Medium:") }}</b> {{ medium }}
|
<b>{{ _("Medium:") }}</b> {{ medium }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
<br>
|
||||||
<p>
|
<p>
|
||||||
{{ _("Visit the following link to view your ") }}
|
<a href="/lms/batches/{{ name }}">👉 {{ _("Visit your batch") }}</a>
|
||||||
<a href="/lms/batches/{{ name }}">{{ _("Batch Details") }}</a>
|
|
||||||
</p>
|
</p>
|
||||||
|
<br>
|
||||||
<p>
|
<p>
|
||||||
{{ _("If you have any questions or require assistance, feel free to contact us.") }}
|
{{ _("If you have any questions or require assistance, feel free to contact us.") }}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -9,19 +9,17 @@
|
|||||||
<p>
|
<p>
|
||||||
<b>{{ _("Class:") }}</b> {{ title }}
|
<b>{{ _("Class:") }}</b> {{ title }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
|
||||||
<p>
|
<p>
|
||||||
<b>{{ _("Date:") }}</b> {{ frappe.utils.format_date(date, "medium") }}
|
<b>{{ _("Date:") }}</b> {{ frappe.utils.format_date(date, "long") }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
|
||||||
<p>
|
<p>
|
||||||
<b>{{ _("Timings:") }}</b> {{ frappe.utils.format_time(time, "hh:mm a") }}
|
<b>{{ _("Timings:") }}</b> {{ frappe.utils.format_time(time, "hh:mm a") }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
<br>
|
||||||
<p>
|
<p>
|
||||||
{{ _("Visit the following link to view your ") }}
|
<a href="/lms/batches/{{ batch_name }}">👉 {{ _("Visit your batch") }}</a>
|
||||||
<a href="/lms/live_classes/{{ batch_name }}">{{ _("Batch Details") }}</a>
|
|
||||||
</p>
|
</p>
|
||||||
|
<br>
|
||||||
<p>
|
<p>
|
||||||
{{ _("If you have any questions or require assistance, feel free to contact us.") }}
|
{{ _("If you have any questions or require assistance, feel free to contact us.") }}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user