Finish implementing webchat
This commit is contained in:
parent
21ca0f2d27
commit
da1a675d8a
2 changed files with 3 additions and 17 deletions
|
|
@ -149,20 +149,12 @@ export default {
|
||||||
transfer.data.last_name &&
|
transfer.data.last_name &&
|
||||||
transfer.data.email
|
transfer.data.email
|
||||||
) {
|
) {
|
||||||
window.embeddedservice_bootstrap.settings.prepopulatedPrechatFields = {
|
window.embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields({
|
||||||
|
ScarlettAISummary: transfer.data.chat_summary,
|
||||||
FirstName: transfer.data.first_name,
|
FirstName: transfer.data.first_name,
|
||||||
LastName: transfer.data.last_name,
|
LastName: transfer.data.last_name,
|
||||||
Email: transfer.data.email,
|
Email: transfer.data.email,
|
||||||
Subject: transfer.data.chat_summary,
|
});
|
||||||
};
|
|
||||||
window.embeddedservice_bootstrap.settings.extraPrechatFormDetails = [
|
|
||||||
{
|
|
||||||
label: "Scarlett AI Summary",
|
|
||||||
value: transfer.data.chat_summary,
|
|
||||||
transcriptFields: ["Scarlett_AI_Summary__c"],
|
|
||||||
displayToAgent: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
if (
|
if (
|
||||||
window.embeddedservice_bootstrap.liveAgentAPI &&
|
window.embeddedservice_bootstrap.liveAgentAPI &&
|
||||||
typeof window.embeddedservice_bootstrap.liveAgentAPI.startChat ===
|
typeof window.embeddedservice_bootstrap.liveAgentAPI.startChat ===
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,6 @@ export const webchatHelper = () => {
|
||||||
if (webchatGlobalNonpersistedState.shouldLaunchSierra) {
|
if (webchatGlobalNonpersistedState.shouldLaunchSierra) {
|
||||||
window.dispatchEvent(new CustomEvent("launch-sierra-webchat")); // launches the sierra chat
|
window.dispatchEvent(new CustomEvent("launch-sierra-webchat")); // launches the sierra chat
|
||||||
} else {
|
} else {
|
||||||
window.embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields({
|
|
||||||
ScarlettAISummary: "sScarletAISummary",
|
|
||||||
FirstName: "sFirstName",
|
|
||||||
LastName: "sLastName",
|
|
||||||
Email: "sEmail",
|
|
||||||
});
|
|
||||||
window.embeddedservice_bootstrap.utilAPI.launchChat(); // launches the salesForce prechat form
|
window.embeddedservice_bootstrap.utilAPI.launchChat(); // launches the salesForce prechat form
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue