Or using Telegram will give better results.
Sorry for my english

define('custom:WhatsApp-handler', ['action-handler'], function (Dep) { return Dep.extend({ actionNewLead: function() { var attributes = {}; attributes.phoneNumber = this.view.model.get('from'); attributes.whatsAppId = this.view.model.get('id'); attributes.whatsAppName = this.view.model.get('name'); attributes.source = "WhatsApp"; var scope = 'Lead' var router = this.getRouter(); router.dispatch(scope, 'create', { attributes: attributes, }); }, initNewLead: function () { this.controlButtonVisibility(); this.view.listenTo( this.view.model, 'change:leadId', this.controlButtonVisibility.bind(this) ); }, controlButtonVisibility: function () { if (this.view.model.get('leadId') === null) { this.view.showHeaderActionItem('NewLead'); return; } this.view.hideHeaderActionItem('NewLead'); }, }); });
Leave a comment: