Documentation/GWC/9.0Draft/WidgetsAPI/CustomEmoji
Customizable Emoji Menu
Introduction
WebChat offers a new v2 emoji menu that lets you choose emoji you want to offer.
Differences between v1 and v2
- v1 shows as a tooltip-style overlay. v2 shows as a new block between the transcript and the message input
- v1 closes when you select an emoji or click outside the menu. v2 lets you choose multiple emoji and only closes if you click the emoji menu button again.
- v1 has 3 fixed emoji to choose from. v2 can show hundreds of customizable emoji in a grid layout
- v1 menu appears in mobile mode. v2 menu is not available in mobile mode (when v2 is configured, no emoji menu button is present in mobile mode).
- v1 menu has default emoji. v2 menu does not have default emoji. It must be explicitly configured with a list of emoji.
Usage
Clicking the Emoji menu icon at the bottom-left corner of the WebChat UI will open the v2 Emoji Menu. The transcript will be resized to fit the emoji menu, which can vary in height dependent on the number of emoji configured.
- When 1-8 emoji are configured, the menu is one row tall, with no scrollbar.
- When 9-16 emoji are configured, the menu is two rows tall, with no scrollbar.
- When 17-24 emoji are configured, the menu is three rows tall, with no scrollbar.
- When 25 or more emoji are configured, the menu is three rows tall, and a scrollbar appears.
Configuring
The v2 emoji menu can be configured by passing a string containing emoji into the webchat configuration or through localization.
File:Important.png
You configure the emoji list by specifying a string of emoji characters like so "๐คฉ๐คช๐คญ๐คซ". WebChat will parse this string and arrange them into the emoji menu.
You can also add titles to emoji so their name will appear when you hover over them. To add a title to emojis, you simple add this extra bit to the string:
"๐คฉ:Star-Struck;๐คช:Zany Face;๐คญ:Face With Hand Over Mouth;๐คซ:Shushing Face;"The format is ๐คฉ:name;
When using titles, you must separate each emoji with a semicolon. You must also separate the title from the emoji character with a colon.
Note: You don't have to add titles for every emoji. You can add titles to only a select few.
Examples:
_genesys.widgets.webchat.emoji = true; // enable emoji menu (for both v1 and v2)
// Configure emoji list with emoji titles
_genesys.widgets.webchat.emojiList = "๐คฉ:Star-Struck;๐คช:Zany Face;๐คญ:Face With Hand Over Mouth;๐คซ:Shushing Face;๐คจ:Face With Raised Eyebrow;โฟ:Bitcoin;๐คฎ:Face Vomiting;๐คฏ:Exploding Head;๐ง:Face With Monocle;๐คฌ:Face With Symbols on Mouth;๐งก:Orange Heart;๐ค:Love-You Gesture;๐คฒ:Palms Up Together;๐ง :Brain;๐ง:Child;๐ง:Person;๐ง:Man: Beard;๐ง:Older Person;๐ง:Woman With Headscarf;๐คฑ:Breast-Feeding;โฟ:Bitcoin;๐ง:Mage;๐ง:Fairy;๐ง:Vampire;๐ง:Merperson;๐ง:Elf;๐ง:Genie;๐ง:Zombie;๐ง:Person in Steamy Room;๐ง:Person Climbing;๐ง:Person in Lotus Position;๐ฆ:Zebra;๐ฆ:Giraffe;๐ฆ:Hedgehog;๐ฆ:Sauropod;๐ฆ:T-Rex;๐ฆ:Cricket;๐ฅฅ:Coconut;๐ฅฆ:Broccoli;๐ฅจ:Pretzel;๐ฅฉ:Cut of Meat;๐ฆ๐บ:Australia Day;๐ซ๐ท:Bastille Day;๐:Birthday;๐:Black Friday;๐จ๐ฆ:Canada Day;๐ง๐ท:Carnaval;๐:Chinese New Year;๐
:Christmas;๐ฒ๐ฝ:Cinco de Mayo;๐ฏ:Diwali;๐จ๐ณ:Dragon Boat Festival;๐ฐ:Easter;๐ฅ:Emoji Movie;๐:Fall / Autumn;๐จ:Fatherโs Day;๐ช:Festivus;๐:Graduation;๐ฅ:Guy Fawkes;๐:Halloween;๐:Hanukkah;๐:Hearts;๐:Holi;๐บ๐ธ:Independence Day;๐ฉ:Motherโs Day;๐:New Yearโs Eve;๐:Olympics;๐ณ๏ธโ๐:Pride;๐:Queenโs Birthday;โช:Ramadan;๐ฑ:Spring;โ:St Patrickโs Day;โ:Summer;๐:Super Bowl;๐ฆ:Thanksgiving;๐:Valentineโs Day;๐ฐ:Wedding / Marriage;โ:Winter;๐ฟ:Winter Olympics;โฝ:World Cup;๐:World Emoji Day;";
// Configure emoji list without emoji titles
_genesys.widgets.webchat.emojiList = "๐คฉ๐คช๐คญ๐คซ๐คจโฟ๐คฎ๐คฏ๐ง๐คฌ๐งก๐ค๐คฒ๐ง ๐ง๐ง๐ง๐ง๐ง๐คฑโฟ๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฅฅ๐ฅฆ๐ฅจ๐ฅฉ๐ฆ๐บ๐ซ๐ท๐๐๐จ๐ฆ๐ง๐ท๐๐
๐ฒ๐ฝ๐ฏ๐จ๐ณ๐ฐ๐ฅ๐๐จ๐ช๐๐ฅ๐๐๐๐๐บ๐ธ๐ฉ๐๐๐ณ๏ธโ๐๐โช๐ฑโโ๐๐ฆ๐๐ฐโ๐ฟโฝ๐";
// Configure emoji list with only a few emoji titles
_genesys.widgets.webchat.emojiList = "๐คฉ๐คช๐คญ๐คซ๐คจโฟ๐คฎ๐คฏ๐ง๐คฌ๐งก๐ค;๐คฒ:Palms Up Together;๐ง ๐ง๐ง๐ง๐ง๐ง๐คฑโฟ๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฅฅ๐ฅฆ๐ฅจ๐ฅฉ๐ฆ๐บ๐ซ๐ท๐;๐:Black Friday;๐จ๐ฆ๐ง๐ท๐๐
๐ฒ๐ฝ๐ฏ๐จ๐ณ๐ฐ๐ฅ๐๐จ๐ช๐๐ฅ๐๐๐๐๐บ๐ธ๐ฉ๐๐๐ณ๏ธโ๐๐โช๐ฑโโ;๐:Super Bowl;๐ฆ๐๐ฐโ๐ฟโฝ๐";
Localization
Emoji can be localized so that each language has a preferred set of emoji and emoji titles.
Note: config overrides localization
Defining emoji inside a localization file is the same as defining it in the webchat configuration. For webchat, the emoji key name is "EmojiList".
Example:
{
"en": {
"webchat": {
"EmojiList": "๐คฉ:Star-Struck;๐คช:Zany Face;๐คญ:Face With Hand Over Mouth;๐คซ:Shushing Face;"
}
}
}Please see the example emoji definitions in the config section for reference. Emoji lists are defined the same way in a localization file as they are defined in the WebChat configuration.


