chore: capture quiz creation and certificate creation for analytics
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user