[Custom Script] Automatic SMS on Creation of New Document

I was looking for a way to send an SMS automatically to customers once the Sales Order was created a few months back, but couldn’t find any way to do it.

Today, I was looking at this again, and I figure out the following Custom Script for anyone else looking for the same feature:

frappe.ui.form.on('Sales Order', 'after_insert', function(frm){
  var message = '[Test] Order No: ' + frm.doc.name + ' has been accepted against ' + (frm.doc.po_no ? ('your PO No: ' + frm.doc.po_no + ' and ') : '');

    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;}




i think its better to do it in the backend side (python). you can create a task and put it in the hooks.py

That may be the case, but not everyone(specifically cloud users) has access to the backend. :smile:

1 Like

@ccfiel, Would you be able to show me how to create a sms task via the back end?

@Tanuj may u help/guide me to configure ErpNEXT for AUTO sms ?

@Tanuj did you find any way ?

Can anyone help me to configure sms setting?