Revision as of 01:41, December 19, 2019 by Bfriend (talk | contribs)
Jump to: navigation, search

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.

V1 v2 Emoji Menu 2.jpg

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.

V2 Emoji Menu Resizing.jpg

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.

Comments or questions about this documentation? Contact us for support!