function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Clement Debrueres-BartoliClement Debrueres-Bartoli 

Can I add an automatic closing phrase when the End Chat button is clicked?

Hey glorious fellas,

I want to add automatically the message "thank you for contacting us" at the end of each of the chat conversations, within the chat conversation itself.

I can also make this text as a custom field value, for example Text_to_display__c.

What would be the best way to achieve this?

I am using Embedded Services for Chat.

Thank you very much and stay safe !
SwethaSwetha (Salesforce Developers) 
HI Clement ,
I believe you can do this by creating Automated Responses for Messaging Channels. In the end chat field of messaging settings, you can set a predefined message that’s sent to the customer when the agent ends the messaging session.

See https://help.salesforce.com/articleView?id=sf.livemessage_create_automated_responses.htm&type=5 for more details

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you