var initESW = function(gslbBaseURL) {
embedded_svc.settings.displayHelpButton = true; //Or false
embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US'
embedded_svc.settings.defaultMinimizedText = 'Chat Support'; //(Defaults to Chat with an Expert)
//embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline)
//embedded_svc.settings.loadingText = ''; //(Defaults to Loading)
//embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session)
// Settings for Chat
//embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
// Dynamically changes the button ID based on what the visitor enters in the pre-chat form.
// Returns a valid button ID.
//};
//embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields
//embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId
//embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us)
embedded_svc.settings.extraPrechatFormDetails = [{
"label":"First Name",
"transcriptFields": ["First_Name__c"],
"displayToAgent":true
}, {
"label":"Last Name",
"transcriptFields": ["Last_Name__c"],
"displayToAgent":true
}, {
"label":"Email",
"transcriptFields": ["Provided_Email__c"],
"displayToAgent":true
}, {
"label": "Event",
"value": "Workday Rising Chat",
"transcriptFields":["Event__c"],
"displayToAgent": true
}, {
"label": "Origin",
"value": "Chat",
"displayToAgent": false
}];
embedded_svc.settings.extraPrechatInfo = [{
"entityFieldMaps": [{
"doCreate":false,
"doFind":false,
"fieldName":"LastName",
"isExactMatch":true,
"label":"Last Name"
}, {
"doCreate":false,
"doFind":false,
"fieldName":"FirstName",
"isExactMatch":true,
"label":"First Name"
}, {
"doCreate":false,
"doFind":false,
"fieldName":"Email",
"isExactMatch":true,
"label":"Email"
}],
"entityName":"Contact",
"saveToTranscript": ""
}];
embedded_svc.settings.enabledFeatures = ['LiveAgent'];
embedded_svc.settings.entryFeature = 'LiveAgent';
embedded_svc.init(
'https://gpjcallcenter.my.salesforce.com',
'https://gpcc.secure.force.com',
gslbBaseURL,
'00D3i000000G5WA',
'Workday_Rising_Chat',
{
baseLiveAgentContentURL: 'https://c.la4-c2-ph2.salesforceliveagent.com/content',
deploymentId: '5723i0000004rli',
buttonId: '5733i0000004sIN',
baseLiveAgentURL: 'https://d.la4-c2-ph2.salesforceliveagent.com/chat',
eswLiveAgentDevName: 'Workday_Rising_Chat_Team',
isOfflineSupportEnabled: false
}
);
};
if (!window.embedded_svc) {
var s = document.createElement('script');
s.setAttribute('src', 'https://gpjcallcenter.my.salesforce.com/embeddedservice/5.0/esw.min.js');
s.onload = function() {
initESW(null);
};
document.body.appendChild(s);
} else {
initESW('https://service.force.com');
}