fix: capture email/comment events
This commit is contained in:
parent
f971178750
commit
5f49744bd0
@ -92,6 +92,7 @@ import AttachmentIcon from '@/components/Icons/AttachmentIcon.vue'
|
|||||||
import AttachmentItem from '@/components/AttachmentItem.vue'
|
import AttachmentItem from '@/components/AttachmentItem.vue'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { TextEditorBubbleMenu, TextEditor, FileUploader } from 'frappe-ui'
|
import { TextEditorBubbleMenu, TextEditor, FileUploader } from 'frappe-ui'
|
||||||
|
import { capture } from '@/telemetry'
|
||||||
import { EditorContent } from '@tiptap/vue-3'
|
import { EditorContent } from '@tiptap/vue-3'
|
||||||
import { ref, computed, defineModel } from 'vue'
|
import { ref, computed, defineModel } from 'vue'
|
||||||
|
|
||||||
@ -139,6 +140,7 @@ function appendEmoji() {
|
|||||||
editor.value.commands.insertContent(emoji.value)
|
editor.value.commands.insertContent(emoji.value)
|
||||||
editor.value.commands.focus()
|
editor.value.commands.focus()
|
||||||
emoji.value = ''
|
emoji.value = ''
|
||||||
|
capture('emoji_inserted_in_comment', { emoji: emoji.value })
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeAttachment(attachment) {
|
function removeAttachment(attachment) {
|
||||||
|
|||||||
@ -88,6 +88,7 @@ import EmailEditor from '@/components/EmailEditor.vue'
|
|||||||
import CommentBox from '@/components/CommentBox.vue'
|
import CommentBox from '@/components/CommentBox.vue'
|
||||||
import CommentIcon from '@/components/Icons/CommentIcon.vue'
|
import CommentIcon from '@/components/Icons/CommentIcon.vue'
|
||||||
import Email2Icon from '@/components/Icons/Email2Icon.vue'
|
import Email2Icon from '@/components/Icons/Email2Icon.vue'
|
||||||
|
import { capture } from '@/telemetry'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { useStorage } from '@vueuse/core'
|
import { useStorage } from '@vueuse/core'
|
||||||
import { call, createResource } from 'frappe-ui'
|
import { call, createResource } from 'frappe-ui'
|
||||||
@ -176,6 +177,10 @@ async function sendMail() {
|
|||||||
let subject = newEmailEditor.value.subject
|
let subject = newEmailEditor.value.subject
|
||||||
let cc = newEmailEditor.value.ccEmails || []
|
let cc = newEmailEditor.value.ccEmails || []
|
||||||
let bcc = newEmailEditor.value.bccEmails || []
|
let bcc = newEmailEditor.value.bccEmails || []
|
||||||
|
|
||||||
|
if (attachments.value.length) {
|
||||||
|
capture('email_attachments_added')
|
||||||
|
}
|
||||||
await call('frappe.core.doctype.communication.email.make', {
|
await call('frappe.core.doctype.communication.email.make', {
|
||||||
recipients: recipients.join(', '),
|
recipients: recipients.join(', '),
|
||||||
attachments: attachments.value.map((x) => x.name),
|
attachments: attachments.value.map((x) => x.name),
|
||||||
@ -200,6 +205,7 @@ async function sendComment() {
|
|||||||
comment_by: getUser()?.full_name || undefined,
|
comment_by: getUser()?.full_name || undefined,
|
||||||
})
|
})
|
||||||
if (comment && attachments.value.length) {
|
if (comment && attachments.value.length) {
|
||||||
|
capture('comment_attachments_added')
|
||||||
await call('crm.api.comment.add_attachments', {
|
await call('crm.api.comment.add_attachments', {
|
||||||
name: comment.name,
|
name: comment.name,
|
||||||
attachments: attachments.value.map((x) => x.name),
|
attachments: attachments.value.map((x) => x.name),
|
||||||
@ -214,6 +220,7 @@ async function submitEmail() {
|
|||||||
newEmail.value = ''
|
newEmail.value = ''
|
||||||
reload.value = true
|
reload.value = true
|
||||||
emit('scroll')
|
emit('scroll')
|
||||||
|
capture('email_sent', { doctype: props.doctype, name: doc.value.data.name })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submitComment() {
|
async function submitComment() {
|
||||||
@ -223,6 +230,7 @@ async function submitComment() {
|
|||||||
newComment.value = ''
|
newComment.value = ''
|
||||||
reload.value = true
|
reload.value = true
|
||||||
emit('scroll')
|
emit('scroll')
|
||||||
|
capture('comment_sent', { doctype: props.doctype, name: doc.value.data.name })
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleEmailBox() {
|
function toggleEmailBox() {
|
||||||
|
|||||||
@ -175,6 +175,7 @@ import AttachmentItem from '@/components/AttachmentItem.vue'
|
|||||||
import MultiselectInput from '@/components/Controls/MultiselectInput.vue'
|
import MultiselectInput from '@/components/Controls/MultiselectInput.vue'
|
||||||
import EmailTemplateSelectorModal from '@/components/Modals/EmailTemplateSelectorModal.vue'
|
import EmailTemplateSelectorModal from '@/components/Modals/EmailTemplateSelectorModal.vue'
|
||||||
import { TextEditorBubbleMenu, TextEditor, FileUploader, call } from 'frappe-ui'
|
import { TextEditorBubbleMenu, TextEditor, FileUploader, call } from 'frappe-ui'
|
||||||
|
import { capture } from '@/telemetry'
|
||||||
import { validateEmail } from '@/utils'
|
import { validateEmail } from '@/utils'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import { EditorContent } from '@tiptap/vue-3'
|
import { EditorContent } from '@tiptap/vue-3'
|
||||||
@ -273,12 +274,14 @@ async function applyEmailTemplate(template) {
|
|||||||
editor.value.commands.setContent(data.message)
|
editor.value.commands.setContent(data.message)
|
||||||
}
|
}
|
||||||
showEmailTemplateSelectorModal.value = false
|
showEmailTemplateSelectorModal.value = false
|
||||||
|
capture('email_template_applied', { email_template: template.name })
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendEmoji() {
|
function appendEmoji() {
|
||||||
editor.value.commands.insertContent(emoji.value)
|
editor.value.commands.insertContent(emoji.value)
|
||||||
editor.value.commands.focus()
|
editor.value.commands.focus()
|
||||||
emoji.value = ''
|
emoji.value = ''
|
||||||
|
capture('emoji_inserted_in_email', { emoji: emoji.value })
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleCC() {
|
function toggleCC() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user