Hi!
I'm trying to change default messages , like "Chat Started" etc in the Widget.
Made a simple working code like this:
<script src="https://apps.mypurecloud.de/widgets/9.0/cxbus.min.js" onload="javascript:CXBus.configure({debug:false,pluginsPath:'https://apps.mypurecloud.de/widgets/9.0/plugins/'}); CXBus.loadPlugin('widgets-core');"></script>
<script>
window._genesys = {
"widgets": {
"webchat": {
"transport": {
"type": "purecloud-v2-sockets",
"dataURL": "https://api.mypurecloud.de",
"deploymentKey": "xxxxxxxx",
"orgGuid": "yyyyyyyyyyy",
"interactionData": {
"routing": {
"targetType": "QUEUE",
"targetAddress": "Test queue",
"priority": 2
}
}
},
"userData": {
"addressStreet": "",
"addressCity": "",
"addressPostalCode": "",
"addressState": "",
"phoneNumber": "",
"customField1Label": "",
"customField1": "",
"customField2Label": "",
"customField2": "",
"customField3Label": "",
"customField3": ""
}
}
}
};
function getAdvancedConfig() {
return {
"form": {
"autoSubmit": false,
"firstname": "",
"lastname": "",
"email": "",
"subject": ""
},
"formJSON": {
"wrapper": "<table></table>",
"inputs": [
{
"id": "cx_webchat_form_firstname",
"name": "firstname",
"maxlength": "100",
"placeholder": "Required",
"label": "First Name"
},
{
"id": "cx_webchat_form_lastname",
"name": "lastname",
"maxlength": "100",
"placeholder": "Required",
"label": "Last Name"
},
{
"id": "cx_webchat_form_email",
"name": "email",
"maxlength": "100",
"placeholder": "Optional",
"label": "Email"
},
{
"id": "cx_webchat_form_subject",
"name": "subject",
"maxlength": "100",
"placeholder": "Optional",
"label": "Subject"
}
]
}
};
}
const customPlugin = CXBus.registerPlugin('Custom');
</script>
<button type="button" id="chat-button" onclick="customPlugin.command('WebChat.open', getAdvancedConfig());">Start Chat</button>
AS per the earlier posts, in order to change labels for default widget, you need to add the code like this:
window._genesys.widgets.main.i18n ={"en":{"webchat":{"ChatStarted": "Chat Started new label"}}};
If I put that code above existing window._genesys block - chat is not working at all. If I put it at the and of this script block - it is not taken into account.
Can you pls guide me where I need to put this block and/or maybe I need to make some additional changes for it to be actually used?
Thanks in advance