email - Auto Reply to Gmail apps for business outside of office hours -


i have created following scripts based on above answer emails mon - fri before 9am , after 5pm in our gmail apps business.

for whatever reason can't see has not been successful. tips. says executes, has 0sec run time, api's gmail enabled.

i can't think has gmail apps business tested on private gmail , worked fine.

the first script weekdays before 9am , after 5pm is

function autoreply()  {      var interval = 5;      var date = new date();      var day = date.getday();      var hour = date.gethours(); if ([1,2,3,4,5].indexof(day) > -1 || (day ==      [1,2,3,4,5] && hour < 9) || (day == [1,2,3,4,5] && hour >= 17))      {         var timefrom = math.floor(date.valueof()/1000) - 60 * interval;         var threads = gmailapp.search('is:inbox after:' + timefrom);         (var = 0; < threads.length; i++)          {             if (threads[i].isunread()){                 threads[i].reply("thank reaching out us. our customer support                  team available monday friday between 9am , 5pm. looking m                  forward helping enquiry during business hours.in                  meantime, please check our asked questions page, delivery page or                  returns page more information can found on our website @                  www.xxxxxxxxxxxxxxx.com.au , follow links @ bottom of                  page.");                 threads[i].markread();                 threads[i].markimportant();             }         }     } } 

the weekend version saturday , sunday @ time

function autoreply() {      var interval = 5;      var date = new date();      var day = date.getday();      var hour = date.gethours(); if ([6,0].indexof(day) > -1 || (day == [6,0] &&      hour < 24) || (day == [6,0] && hour >= 0))     {          var timefrom =          math.floor(date.valueof()/1000) - 60 * interval; var threads =          gmailapp.search('is:inbox after:' + timefrom); (var = 0; <          threads.length; i++)          {              if (threads[i].isunread())             { threads[i].reply("thank                  reaching out us.our customer support team available monday                  friday between 9am , 5pm. looking forward helping                  enquiry during business hours.in meantime, please check our                  asked questions page, delivery page or returns page more information                  can found on our website @ www.xxxxxxxxxxxxxxx.com.au , follow                  links @ bottom of page.");                 threads[i].markread();                 threads[i].markimportant();             }         }     } } 

thanks in advance advice

is there error missing in mess have created?

this can done settings in gmail itself. have predefined options can set auto-respond reply in timeings have set.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -