Sending SMS on creation of Customer

Hi,

I’m trying to send SMS to the customer, on completion of saving customer doctype.

Custom Script I have tried , looks like this :point_down:

frappe.ui.form.on('Customer', 'after_insert', function(frm){
  var message = This is test message for successful registration in erpnext;

console.log(message);
  frappe.call({
    method: "erpnext.setup.doctype.sms_settings.sms_settings.send_sms",
    args: {
      receiver_list: [frm.doc.contact_mobile],
      msg: message,
    },
    callback: function(r) {
      if(r.exc) {msgprint(r.exc); return;}
    }
  });


})

But results in erorr, can someone help on this !!

Regards
vishnu

1 Like