0

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,
            }
        }
    },
};

A. Asensio
  • 25
  • 5

2 Answers2

1

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
yvesonline
  • 4,609
  • 2
  • 21
  • 32
  • It doesnt works with componentProps. Edited is my componentProps configuration. It should show a message: "Funciona", but instead sends the standard welcome message. – A. Asensio Apr 14 '21 at 07:35
  • @A.Asensio your example code shows `PredefinedMessage` but the property should be `predefinedMessage` with a lowercase "p". – philnash Apr 19 '21 at 06:21
  • Still not working with 'predefinedMessage' – A. Asensio Apr 19 '21 at 06:50
0

In my case it worked with defaultProps

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

Pedro1970
  • 1
  • 1