This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page > | |
<!--BEGIN Chat Button Code Snippet--> | |
<a id="liveagent_button_online_5733i000000gfJr" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('5733i000000gfJr')"><!-- Online Chat Content --></a><div id="liveagent_button_offline_5733i000000gfJr" style="display: none;"><!-- Offline Chat Content --></div><script type="text/javascript"> | |
if (!window._laq) { window._laq = []; } | |
window._laq.push(function(){liveagent.showWhenOnline('5733i000000gfJr', document.getElementById('liveagent_button_online_5733i000000gfJr')); | |
liveagent.showWhenOffline('5733i000000gfJr', document.getElementById('liveagent_button_offline_5733i000000gfJr')); | |
});</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page > | |
<!--BEGIN Chat Button Code Snippet--> | |
<a id="liveagent_button_online_5733i000000gfJr" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('5733i000000gfJr')"><!-- Online Chat Content --></a><div id="liveagent_button_offline_5733i000000gfJr" style="display: none;"><!-- Offline Chat Content --></div><script type="text/javascript"> | |
if (!window._laq) { window._laq = []; } | |
window._laq.push(function(){liveagent.showWhenOnline('5733i000000gfJr', document.getElementById('liveagent_button_online_5733i000000gfJr')); | |
liveagent.showWhenOffline('5733i000000gfJr', document.getElementById('liveagent_button_offline_5733i000000gfJr')); | |
});</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page> | |
<!--BEGIN Chat Button Code Snippet--> | |
<a id="liveagent_button_online_5733i000000gfJr" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('5733i000000gfJr')"><!-- Online Chat Content --></a><div id="liveagent_button_offline_5733i000000gfJr" style="display: none;"><!-- Offline Chat Content --></div><script type="text/javascript"> | |
if (!window._laq) { window._laq = []; } | |
window._laq.push(function(){liveagent.showWhenOnline('5733i000000gfJr', document.getElementById('liveagent_button_online_5733i000000gfJr')); | |
liveagent.showWhenOffline('5733i000000gfJr', document.getElementById('liveagent_button_offline_5733i000000gfJr')); | |
});</script> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'https://YOUR_DOMAIN_HERE.force.com/survey/runtimeApp.app?invitationId='+ | |
[SurveyInvitation].Id+ | |
'&surveyName=YOUR_SURVEY_API_NAME_HERE&UUID=' | |
+[SurveyInvitation].UUID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.THIS { | |
position: relative; | |
z-index: 1; | |
} | |
.THIS .surveyRuntimeSurvey.surveyScreen { | |
min-width: 0; | |
margin: -13px; | |
width: calc(100% + 25px) !important; | |
padding-bottom: 50px !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="forceCommunity:themeLayout" access="global" description="Custom Community Theme Layout for post-chat surveys with no header"> | |
<div> | |
<div class="mainContentArea"> | |
{!v.body} | |
</div> | |
</div> | |
</aura:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page controller="SurveyRedirectController" action="{!redirectToSurvey}" > | |
</apex:page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SurveyRedirectController { | |
public PageReference redirectToSurvey() { | |
String url = [SELECT Id, Survey_URL__c, ChatKey FROM LiveChatTranscript WHERE ChatKey = : ApexPages.currentPage().getParameters().get('chatKey')].Survey_URL__c; | |
PageReference surveyURL = new PageReference(url); | |
return surveyURL; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This trigger updates the LiveChatTranscript.Survey_URL__c field with a valid SurveyInvitation URL and creates a lookup relationship from the SurveyInvitation.Chat_Transcript__c to the LiveChatTranscript | |
trigger LiveChatTranscript_CreateSurveyURL on LiveChatTranscript (before update) { | |
for (LiveChatTranscript lct : Trigger.New){ | |
if(lct.Status == 'Waiting'){ | |
List<SurveyInvitation> thisSurveyInvitation = [SELECT Id, UUID, Name FROM SurveyInvitation WHERE ChatKey__c = :lct.ChatKey LIMIT 1]; | |
//Set the surveyName variable to the API name of your Survey record | |
lct.Survey_URL__c = 'https://sdodemo-main-166ce2cf6b6-16bd728c779.force.com/consumer/survey/runtimeApp.app?invitationId=' + thisSurveyInvitation[0].Id + '&surveyName=hutch_test&UUID=' + thisSurveyInvitation[0].UUID; | |
if (thisSurveyInvitation.size() > 0){ | |
try { | |
thisSurveyInvitation[0].Chat_Transcript__c = lct.Id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This trigger creates a new SurveyInvitaion record for each LiveChatTranscript for use in a post-chat survey | |
//This trigger assumes that a Contact record has been associated with each LiveChatTranscript, for example using a pre-chat form | |
trigger LiveChatTranscript_CreateSurveyInvitation on LiveChatTranscript (before insert) { | |
for (LiveChatTranscript lct : Trigger.New){ | |
if(lct.ContactId != null){ | |
//Change %Consumer% in the following line to a unique keyword for the Community Name where your surveys are published | |
List<Community> thisCommunity = [SELECT NetworkId FROM Community WHERE Name LIKE '%Consumer%' LIMIT 1]; | |
//Change %Hutch% in the following line to a unique keyword for the Survey you want to show your chat users | |
List<Survey> thisSurvey = [SELECT Id,Name FROM Survey WHERE Name LIKE '%Hutch%' LIMIT 1]; | |
NewerOlder