Her hafta yinelenen Gmail için "işyeri dışında" yanıtları ayarlayabilir miyim?


11

Sadece pazartesiden çarşambaya kadar çalışıyorum. Bunu ayarlamak istiyorum, böylece müşteriler her hafta bu günlerde bana e-posta gönderdiklerinde, dostça bir hatırlatma alırlar. Bunu nasıl yapabilirim? Görünüşe göre her hafta manuel olarak yapmam gerekecek gibi görünüyor.


Soru herhangi bir araştırma çabası göstermiyor. Lütfen Nasıl Sorulur'a bakın .
Rubén

Yanıtlar:


6

Cevabımı durumunuza benzer bir soruya uyarladım . Bu Apps Komut Dosyası , geçerli gün Perşembe (4), Cuma (5), Cumartesi (6) veya Pazar (0) arasındaysa yanıt verecektir. Gün kümesi, aşağıda belirtildiği gibi ayarlanabilir.

function autoReply() {
  var interval = 5;          //  if the script runs every 5 minutes; change otherwise
  var daysOff = [4,5,6,0];   // 1=Mo, 2=Tu, 3=We, 4=Th, 5=Fr, 6=Sa, 0=Su
  var message = "This is my day off.";
  var date = new Date();
  var day = date.getDay();
  if (daysOff.indexOf(day) > -1) {
    var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
    var threads = GmailApp.search('is:inbox after:' + timeFrom);
    for (var i = 0; i < threads.length; i++) {
      threads[i].reply(message);
    }
  }
}

5

Bence haklısın; Yalnızca bir başlangıç ​​tarihi ve isteğe bağlı bir bitiş tarihi eklemenin bir yolunu görüyorum. Bunu yalnızca Gmail ile otomatikleştiremezsiniz. Birisinin böyle bir şey yarattığını varsayarak, harici bir araca ihtiyacınız olacak. Bununla birlikte, Google Apps Script'i bilen bir kişi bir şeyler oluşturabilir.

Değer için, Outlook bu tür şeyleri yapmanıza izin vermez.

En iyi durumda, Gmail ile, herhangi bir günde bir kişiye mesaj göndermek için otomatik tatil yanıtlayıcıyı kullanabilirsiniz. Bir kişiden birkaç mesaj alırsanız mesajı birkaç kez göndermemesi oldukça akıllıdır.


1

User79865 'e kıyasla güncellenmiş bir sürüm yazdım, cevaplamak için e-posta için etiket eklemek yerine zaman kullanmak, daha doğru olacaktır.

function autoReply() {
  var scheduled_date = [
    '2016-12-19', '2016-12-20',
  ];
  var auto_reply = "I am out of office. Your email will not seen until Monday morning.";

  var now = new Date();
  var today = now.toISOString().slice(0, 10); // today format: '2017-01-01'

  var label = GmailApp.getUserLabelByName('auto-replyed') || GmailApp.createLabel('auto-replyed');

  // today is the scheduled date
  if (scheduled_date.indexOf(today) >= 0) { 
    // get all email inbox, unread, without label auto-replyed
    var threads = GmailApp.search('is:unread is:inbox -{label:auto-replyed}');
    for (var i = 0; i < threads.length; i++) {
      var thread = threads[i]
      // reply the email and add auto-replyed label
      thread.reply(auto_reply);
      thread.addLabel(label);
    }
  }
}

0

Linjunhalida etiketli bir sürüm almak için 2 komut dosyasını birleştirdim, ancak user79865'in komut dosyasında olduğu gibi tarihleri ​​girmek yerine bir gün seçebiliyorum:

function autoReply() {
  var scheduled_date = [
    '2019-09-20', '2019-09-27',
  ];
  var auto_reply = "I am out of office today. I'll get back to you as soon as possible next week.";

  var now = new Date();
  var today = now.toISOString().slice(0, 10); // today format: '2017-01-01'

  var label = GmailApp.getUserLabelByName('auto-replyed') || GmailApp.createLabel('auto-replyed');

  // today is the scheduled date
  if (scheduled_date.indexOf(today) >= 0) { 
    // get all email inbox, unread, without label auto-replyed
    var threads = GmailApp.search('is:unread is:inbox -{label:auto-replyed}');
    for (var i = 0; i < threads.length; i++) {
      var thread = threads[i]
      // reply the email and add auto-replyed label
      thread.reply(auto_reply);
      thread.addLabel(label);
    }
  }
}

0

Bunu bir süre kullandıktan sonra, bakmak isteyebileceğiniz başka birkaç iyileştirme ve iyileştirme var:

function autoReply() {
  var interval = 5;        //  if the script runs every 5 minutes; change otherwise
  var daysOff = [1,5,6,0];   // 1=Mo, 2=Tu, 3=We, 4=Th, 5=Fr, 6=Sa, 0=Su
  var date = new Date();
  var day = date.getDay();
  var label = GmailApp.getUserLabelByName("autoresponded");
  if (daysOff.indexOf(day) > -1) {
    var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
    var threads = GmailApp.search('is:inbox !label:autoresponded after:' + timeFrom);
    for (var i = 0; i < threads.length; i++) {
      var message = threads[i].getMessages()[0];
      if (message.getFrom().indexOf("myemail@gmail.com") < 0 && message.getFrom().indexOf("no-repl") < 0 && message.getFrom().indexOf("bounce") < 0 && message.getFrom().indexOf("spam") < 0) {
        threads[i].reply("", {
          htmlBody: "<p>Thank you for your message. I am not in the office today. If you have urgent questions you can email office@example.com. If you have other urgent enquiries you can call the office on 1800 999 002.</p><p>Best regards,<br>Name</p>"
        });
        label.addToThread(threads[i]);
      }
    }
  }
}
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.