Recent searches
No recent searches
How to Chat bot custom greeting message?
Answered
Posted Nov 22, 2023
I am using chat Bot web widget in my website it's awesome. Now i want to know how i can add my login user name in greeting message. Login user name will come form my database. When conversation is start. like this "Hi Josh, I'm here to help.
1
1
1 comment
Dakota
I'm no coding wizard but I believe it would require some level of backend coding.
Would likely require something like this. When the user logs into your website, store their name (e.g. "Josh") in a session variable or some other server-side storage that you can access later.
In your chatbot code, retrieve the logged-in username from the server-side storage before configuring the chatbot.
For example:
// Get logged in user's name
const name = getLoggedInUserName();
// Configure chatbot
const chatbot = new Chatbot();
// Customize greeting
chatbot.setGreeting(`Hi ${name}, I'm here to help.`);
The chatbot should now greet the user with their name fetched from the server-side storage:
"Hi Josh, I'm here to help."
0