chore: capture quiz creation and certificate creation for analytics

This commit is contained in:
Jannat Patel
2026-01-15 10:18:09 +05:30
parent 19258e263d
commit 078f18d99c
3 changed files with 8 additions and 1 deletions
@@ -7,6 +7,7 @@ from frappe.email.doctype.email_template.email_template import get_email_templat
from frappe.model.document import Document
from frappe.model.naming import make_autoname
from frappe.utils import nowdate
from frappe.utils.telemetry import capture
class LMSCertificate(Document):
@@ -17,6 +18,10 @@ class LMSCertificate(Document):
self.name = make_autoname("hash", self.doctype)
def after_insert(self):
self.send_certification_email()
capture("certificate_issued", "lms")
def send_certification_email(self):
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)