AMAZD allows setting a different configuration based on a schedule.

Being available 24/7 is not always the right option for each company. Hence, we have the possibility to use the scheduling flow during off-times, where the experts are not available.

In order to set up a fall back option, it is possible to use the following code.

<script>
var amazdSpecialSchedule = {
 monday: [
   { from: "09:00", to: "17:00" }
 ],
 tuesday: [
   { from: "09:00", to: "17:00" }
 ],
 wednesday: [
   { from: "09:00", to: "17:00" }
 ],
 thursday: [
   { from: "09:00", to: "17:00" }
 ],
 friday: [
   { from: "09:00", to: "17:00" }
 ],
 saturday: [
   { from: "09:00", to: "00:00" }
 ],
 sunday: [
   { from: "09:00", to: "00:00" }
 ]
};
function amazdInSpecialSchedule() {
 function addZero(s) { return s < 10 ? "0" + s : s; }
 var daymap = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
 var d = new Date();
 var dayNumber = d.getUTCDay();
 var curTime = addZero(d.getUTCHours()) + ":" + addZero(d.getUTCMinutes());
 var intervals = amazdSpecialSchedule[daymap[dayNumber]] || [];
 return intervals.find(function(i) { return curTime >= i.from && curTime <= i.to; });
}
var amazdSettings;
if (amazdInSpecialSchedule()) {
 // In working hours
 amazdSettings = {
   company: "acme",
   showDeflectionScreen: true,
   showSchedulingScreen: true
 };
} else {
 // Outside working hours
 amazdSettings = {
   company: "amazd",
   showDeflectionScreen: true,
   showExpertProfileScreen: false
 };
}
 
(function (d, s) { var e = d.createElement(s), t = d.getElementsByTagName(s)[0]; e.async = true; e.src = 'https://widget.amazd.co/widget.js'; t.parentNode.insertBefore(e, t);})(document, 'script');
</script>

Explanation:

There is three parts to this code:

  1. Outside working hours
  2. During working hours
  3. Variable definition

Outside working hours

During working hours generally, an instant flow is recommended. In order to get in touch with your customers immediately, use the for you recommended flow settings. More information on specific flow settings can be found here.

In the code snippet above you can edit the working hours. Please be aware that the times need to be stated in the 00:00 - 24:00 system and UTC.

During working hours

The time in the evenings and e.g. on the weekends can be covered with the help of scheduled interactions. For this simply use the company-wide scheduling to offer the customer the best possible experience. More information on this can be found here.

IMPORTANT
Please be aware that the experts need to stay online in order to schedule appointment with them. If the expert is deactivated no meetings will be allocated to them.

Variable definition

There is no need to touch the variable section. Please ensure that the code is copied entirely.