(Update with the copy of version: draft) |
(Update with the copy of version: draft) |
||
Line 13: | Line 13: | ||
== open == | == open == | ||
− | Opens the Offers Widget and renders an offer based on the | + | Opens the Offers Widget and renders an offer based on the options provided. If no options are provided, it renders the default offer defined in the configuration. |
=== Example === | === Example === | ||
Line 39: | Line 39: | ||
! Type | ! Type | ||
! Description | ! Description | ||
+ | ! Accepted Values | ||
|- | |- | ||
| mode | | mode | ||
| string | | string | ||
| Widget display type | | Widget display type | ||
+ | | overlay, toaster | ||
|- | |- | ||
| layout | | layout | ||
| string | | string | ||
| Additional layout options for overlay | | Additional layout options for overlay | ||
+ | | leftText, rightText | ||
|- | |- | ||
| title | | title | ||
| string | | string | ||
| String for widget title | | String for widget title | ||
+ | | n/a | ||
|- | |- | ||
| headline | | headline | ||
| string | | string | ||
| String for Offer title header | | String for Offer title header | ||
+ | | n/a | ||
|- | |- | ||
| body | | body | ||
| string | | string | ||
| String for offer body text | | String for offer body text | ||
+ | | n/a | ||
|- | |- | ||
| button | | button | ||
| string | | string | ||
| String for CTA button text | | String for CTA button text | ||
+ | | n/a | ||
|- | |- | ||
| ctaURL | | ctaURL | ||
| string - URL | | string - URL | ||
| URL for call to action | | URL for call to action | ||
+ | | n/a | ||
|- | |- | ||
| image | | image | ||
| string - URL | | string - URL | ||
| Image URL string | | Image URL string | ||
+ | | n/a | ||
|- | |- | ||
| video | | video | ||
| string - URL | | string - URL | ||
| Video URL string, YouTube/Vimeo | | Video URL string, YouTube/Vimeo | ||
+ | | n/a | ||
|- | |- | ||
| timeout | | timeout | ||
| number | | number | ||
| Timeout integer in ms | | Timeout integer in ms | ||
+ | | n/a | ||
|- | |- | ||
|} | |} |
Revision as of 16:08, December 21, 2018
Contents
API Commands
Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object.
Important
The global bus object is a debug tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see Widgets Extensions for more information about extending Genesys Widgets.var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.command('Offers.open');
configure
Internal use only. The main App plugin shares configuration settings to widgets using each widget’s configure command. The configure command can only be called once at startup. Calling configure again after startup may result in unpredictable behavior.
open
Opens the Offers Widget and renders an offer based on the options provided. If no options are provided, it renders the default offer defined in the configuration.
Example
oMyPlugin.command('Offers.open', {
mode:'overlay',
layout:'leftText',
title:'Offer Title',
headline:'This is the headline',
body:'This is the body',
button:'Accept Offer',
ctaURL:'http://www.genesys.com',
video:'https://www.youtube.com/watch?v=########',
timeout: 11000,
});
Options
Option | Type | Description | Accepted Values |
---|---|---|---|
mode | string | Widget display type | overlay, toaster |
layout | string | Additional layout options for overlay | leftText, rightText |
title | string | String for widget title | n/a |
headline | string | String for Offer title header | n/a |
body | string | String for offer body text | n/a |
button | string | String for CTA button text | n/a |
ctaURL | string - URL | URL for call to action | n/a |
image | string - URL | Image URL string | n/a |
video | string - URL | Video URL string, YouTube/Vimeo | n/a |
timeout | number | Timeout integer in ms | n/a |
Resolutions
Status | When | Returns |
---|---|---|
resolved | When configuration options are provided, valid and set | n/a |
rejected | When no valid configuration options are provided | 'Invalid configuration; detailed CXBus warning' |
close
Closes an open offers widget.
Example
oMyPlugin.command('Offers.close');
Resolutions
Status | When | Returns |
---|---|---|
resolved | When the widget is closed | n/a |
rejected | When the widget is already closed | 'CXBus warning.' |
Comments or questions about this documentation? Contact us for support!