Hi,
I am trying to use frappe.core.doctype.communication.email.make to send emails on the creation of statements. This has to be done via a custom script as only statements with customers with emails need to be sent, and the other customers without emailneed to appear in a printout at the end.
Every time I try sending an email I get Object { emails_not_sent_to: null, name: “151f73a4f7” } etc and have checked the source code on frappe but still can’t work out what I am doing wrong. Code is as per below.
frappe.call({
method: “frappe.core.doctype.communication.email.make”,
args: {
sender:"admin@mydomain.com",
sender_full_name:“my company”,
recipients:"test@test.com",
content:“Test Mail”,
subject:“Test-mail-001”,
doctype:“Statement”,
name:r.message.statement.name,
print_html:“Standard”,
print_format:“Standard”,
send_email:true
},
async:false,
callback: function (r) {
if (!r.exc) {
console.log(r.message);