Contents
API Commands
close
Closes the Send Message UI.
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When Send Message is successfully closed | n/a |
| rejected | When Send Message is already closed | 'already closed' |
configure
Modify configuration options for Send Message.
Options
| Option | Type | Description |
|---|---|---|
| formValidation | boolean | Enable/disable browser form validations. |
| SendMessageButton.enabled | boolean | Enable/disable Send Message button on screen. |
| SendMessageButton.template | string | Custom HTML string template for Send Message button. |
| SendMessageButton.effect | string | Type of animation effect when revealing Send Message button ('slide' or 'fade'). |
| SendMessageButton.openDelay | number | Number of milliseconds before displaying send message button on screen. |
| SendMessageButton.effectDuration | number | Length of animation effect in milliseconds. |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When configuration options are provided and set | n/a |
| rejected | When no configuration options are provided | 'Invalid configuration' |
minimize
Minimize or Unminimize Send Message UI.
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | Always | n/a |
| rejected | Never | n/a |
showSendMessageButton
Makes the standalone Send Message button visible on the screen using either the default template and CSS or customer-defined ones.
Options
| Option | Type | Description |
|---|---|---|
| openDelay | number | Duration in milliseconds to delay showing the send message buton on the page |
| duration | number | Duration in milliseconds for the show and hide animation. |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When the Send Message button is enabled in the configuration, is currently not visible, and the SideBar plugin is not initialized | n/a |
| rejected | When the Send Message button is not enabled in the configuration, or it's already visible, or the SideBar plugin is initialized | 'Send Message button is already visible. Ignoring command.' |
| rejected | When the sidebar plugin is active the standalone send Message button will be disabled automatically | 'SideBar is active and overrides the default Send Message button' |
hideSendMessageButton
Hides the standalone Send Message button.
Options
| Option | Type | Description |
|---|---|---|
| duration | number | Duration in milliseconds for the show and hide animation |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When the send message button is currently visible | n/a |
| rejected | When the send message button is already hidden | 'Send Message button is already hidden. Ignoring command.' |
readFormData
Reads all the form values from the specified input fields
Options
| Option | Type | Description |
|---|---|---|
| formInputs | array | id's of input elements |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When Send Message form is read successfully | n/a |
| rejected | When Send Message form is not valid | 'Form not valid' |
submitForm
The user entered form data and attached files are submitted
Options
| Option | Type | Description |
|---|---|---|
| firstName | string | value for the First Name entry field |
| lastName | string | value for the Last Name entry field |
| string | value for the Email entry field | |
| subject | string | value for the Subject entry field |
| text | string | value for the email body text content entry field |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When Send Message form is submitted successfully | n/a |
| rejected | When form data entry fields are missing | 'No form data found' |
open
opens the send message widget UI.
Options
| Option | Type | Description |
|---|---|---|
| form | object | Object containing form data to prefill in the send message form and optionally auto-submit the form. |
| form.autoSubmit | boolean | Automatically submit the form and send an email with prefilled content. |
| form.validation | boolean | Enables/Disables validating the form data while submitting. By default, its enabled. |
| form.firstname | string | Value for the first name entry field. |
| form.lastname | string | Value for the last name entry field. |
| form.email | string | Value for the email entry field. |
| form.subject | string | Value for the subject entry field. |
| text | string | value for the email body text content entry field |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When Send Message is successfully opened | n/a |
| rejected | When Send Message is already open | 'Already opened' |
Comments or questions about this documentation? Contact us for support!
