A. Asensio
A. Asensio

Reputation: 25

Twilio Flex Webchat welcome message

I want to change the default WelcomeMessage of Twilio Flex Webchat. I´m running webchat from npm package. Below is my webchat-appConfig.js code. When I execute it, the webchat loads but the WelcomeMessage doesn´t change.

var appConfig = {
    componentProps: {
        MainContainer: {
            height: '80%'
        },
        MainHeader: {
            showTitle: true,
            titleText: 'Alfredo Prueba',
            imageUrl: '',
        },
        MessagingCanvas: {
            PredefinedMessage: {
                body: 'Funciona',
                authorName: 'Alfredo',
                isFromMe: false,
            },
            memberDisplayOptions: {
                yourDefaultName: 'Tú',
                yourFriendlyNameOverride: false,
            }
        }
    },
};

Upvotes: 0

Views: 643

Answers (2)

Pedro1970
Pedro1970

Reputation: 1

In my case it worked with defaultProps

Here is what I used: Twilio.FlexWebChat.MessagingCanvas.defaultProps.predefinedMessage.body = "Your Welcome Message";

Upvotes: 0

yvesonline
yvesonline

Reputation: 4837

You need to override PredefinedMessage.

You can do this via:

  • the componentProps section in the configuration object, or
  • the defaultProps API, in your case this would be FlexWebChat.MessagingCanvas.defaultProps.predefinedMessage

Upvotes: 1

Related Questions