Skip to content

Application generator

ViewController

In order for a generator form to work, you need to register a ViewController with the offline_message_generator

CreateWidget

To create an application generator widget, use the method CallGear.UI.createWidget() with the following parameters:

  • widgetName = 'offline_message_generator'
  • the config object must contain the field id

Example:

CallGear.UI.registerViewController('offline_message_generator', function (settings, tpls) {
    var offlineMessageGenerator = CallGear.UI.createWidget('offline_message_generator', {
        settings: settings,
        template: tpls['offline_message_generator'],
        id: settings['id']
    });
    offlineMessageGenerator.render();
});

Methods

submit(data)

The method captures a successful display of a form and saves the data received from the application. In the lead generation report, such impression will be considered as a lead.

The data object should contain the following fields:

  • name - Visitor name.
  • email - Visitor e-mail.
  • phone - Visitor phone number.
  • message - Application text.
  • group_id - ID of an employees group to which this application should apply. The field must be filled in if the application generator is configured to distribute applications by groups of employees.

cancel()

Method captures unsuccessful displays of a form. In the lead generation report, such impression will be considered a failure.

Sending applications.

Events

leadhide

The event occurs when you need to hide the previously shown form. This is necessary if a visitor interacts with several pages of the website at once.

leadsubmit

The event occurs in response to a call to the submit () method and confirms that the lead has been processed.

leadcancel

The event occurs in response to a call to the cancel() method and confirms that a failure from a visitor has been captured.

Sandbox

Desktop, tablet:

Mobile: