CMS

Using the ServisBOT CMS, it is possible to manage rich media for your bot responses. The CMS is made up of two sections, Content and Assets. This is also supported in our CLI under the following command sb-cli content

Using Locales

When creating or editing CMS items, it is possible to create language variants of any of our supported languages. At a minimum, please make sure to create an en variant for any CMS entry to ensure you have a fallback in place.

When a bot is referencing content from the CMS, it will respond content variants that match the local set in the conversation’s lang context value. This can be set by either using setContext node in a flow, or as a property when initializing messenger.

How Locales are Matched to Context

  • Both languages (en, es, fr, de) and locales (ex-mx, fr-ca) are valid settings for context and keys.
  • If a valid locale is specified in context (es-mx) and a content variant for that key exists for that locale (es-mx), that variant will be used.
  • If a valid locale is specified in context (es-mx), and no content variant for that key exists for that locale, but a content variant does exist for the associated country code (es), the content associated with just the country code is used.
  • If no locale or an invalid locale is specified, but content does exist for the default locale (en), then the content associated with the default locale is used.
  • If no locale is specified or an invalid locale is specified, and no content exists for the default locale, an appropriate warning will be displayed instead of content.

Content

Content entries are canned responses for your bot. The following types of content are supported:

Plain Text

Your bot will respond with a simple text message. This content is usable in any Send Markup event by bots by using the {CMS: key} syntax.

Markup

Your bot will respond with a markup driven response.

Note: It is possible to use uploaded assets as part of your markup response, (see the Assets section below), and you can also use externally stored assets.

Timeline markup in CMS can only have interactionType of Utterance.

Assets

Assets are files you want to share, these are files you upload to ServisBOT and are stored within your account. When you create an asset you are given a URL used to display it. You can use this URL in the content entry when you have it set to markup. This can be used to show images as a card, or files as a file previews. You can get the URL of the asset on the asset section of the CMS.

Alternatively, you can reference the asset URL using the asset tag and the asset Alias. The asset tag takes the format of {asset:asset-alias}.

Using Content

There are two ways you can use the content:

  • Plaintext CMS content can be used in any markup to replace strings. This includes the send markup action for intents, the send markup node in classic flow, and the interaction node in classic flow
  • Entire content can be stored in CMS including the timeline markup. Note that at this time, only markup with interactionType of utterance is compatible with CMS in full markup mode. Entire Markup can be used using the Send Content action in intents, and the CMS node in classic flow.

Classic Flow

To use timeline content stored in classic flow you need to know the content key of your cms entry. Drag the CMS node onto the canvas where you want it in the flow.

Finally, choose variable to set the content key via variable in a flow, or Content Key to select it from a list. Content Key will also provide you with a CMS preview and edit capabilities.

To use localized Plaintext content in markup, use either the Interaction node or the Markup node. Any of the text fields in markup can be replaced with {CMS:key}.

Sb Intents

When you want to use timeline CMS content entries in sb intents, create an intent in your bot. In the fulfillment section, select the botnet action of type Send CMS content. This will then give you a drop list of all your available cms content entries. Once saved when that intent is triggered, that piece of content will then be sent out.

To use localized Plaintext content in markup, use either the Interaction node or the Markup node. Any of the text fields in markup can be replaced with {CMS:key}.

Content with PDF file

Below is a content item with a PDF file in it:

Below is the same content item but using an asset reference instead of an absolute url:

Content with an Image

Below is a content item with an Image file in it: