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

View File

@@ -464,7 +464,6 @@ const validateFields = () => {
!['description', 'batch_details'].includes(key) &&
typeof batch[key] === 'string'
) {
console.log(key)
batch[key] = escapeHTML(batch[key])
}
})

View File

@@ -144,9 +144,11 @@ import { computed, inject, onMounted, ref, watch } from 'vue'
import { Plus } from 'lucide-vue-next'
import { sessionStore } from '@/stores/session'
import { escapeHTML } from '@/utils'
import { useTelemetry } from 'frappe-ui/frappe'
import EmptyState from '@/components/EmptyState.vue'
const { brand } = sessionStore()
const { capture } = useTelemetry()
const user = inject('$user')
const dayjs = inject('$dayjs')
const router = useRouter()
@@ -216,6 +218,7 @@ const insertQuiz = (close) => {
toast.success(__('Quiz created successfully'))
close()
title.value = ''
capture('quiz_created')
router.push({
name: 'QuizForm',
params: {

View File

@@ -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"
)