Hi , I was trying to code a button to send e-mails. I borrowed the below code from communication.js and running it on console gives the screenshot below.
Code : (run in console)
new frappe.views.CommunicationComposer({
subject: 'Ping',
recipients: "support@metadrex.in",
message: "Hi ya doin",
doc: {
doctype: "User",
name: frappe.session.user
}
})
Result:
But when i click send i get the below error on console.
communication.js:607 Uncaught TypeError: Cannot read property 'doctype' of undefined
at init.delete_saved_draft (communication.js:607)
at frappe.ui.Dialog.primary_action (communication.js:23)
at HTMLButtonElement.<anonymous> (dialog.js:149)
at HTMLButtonElement.dispatch (jquery.min.js:3)
at HTMLButtonElement.r.handle (jquery.min.js:3)
I am not able to debug this error, any pointers?