월요일부터 수요일까지만 일합니다. 고객이 매주 요즘 이메일을 보낼 때 친근한 알림을 받도록 설정하고 싶습니다. 어떻게해야합니까? 외관상으로는 매주 수동으로해야 할 것 같습니다.
월요일부터 수요일까지만 일합니다. 고객이 매주 요즘 이메일을 보낼 때 친근한 알림을 받도록 설정하고 싶습니다. 어떻게해야합니까? 외관상으로는 매주 수동으로해야 할 것 같습니다.
답변:
귀하의 상황 과 비슷한 질문 에 대한 답변을 수정했습니다 . 이 앱 스크립트 는 현재 날짜가 목요일 (4), 금요일 (5), 토요일 (6) 또는 일요일 (0) 중 하나 인 경우 응답합니다. 요일 설정은 아래와 같이 조정할 수 있습니다.
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);
}
}
}
당신이 맞다고 생각합니다. 시작 날짜와 선택적 종료 날짜를 추가하는 방법 만 보입니다. Gmail만으로는이 기능을 자동화 할 수 없습니다. 누군가가 그런 것을 만들었다 고 가정하면 외부 도구가 필요합니다. 하지만 Google Apps Script에 능숙한 사람은 무언가를 만들 수 있습니다.
그만한 가치가 있기 때문에 Outlook에서는 이러한 종류의 작업을 수행 할 수 없습니다.
기껏해야 Gmail을 사용하면 휴가 자동 응답을 사용하여 언제든지 누구에게나 메시지를 보낼 수 있습니다. 한 사람으로부터 여러 개의 메시지를 받으면 여러 번 메시지를 보내지 않는다는 점에서 매우 현명합니다.
user79865와 비교하여 업데이트 된 버전을 작성했으며 시간을 사용하는 대신 회신 이메일에 레이블을 추가하면 더 정확합니다.
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);
}
}
}
linjunhalida의 레이블이있는 버전을 얻기 위해 2 개의 스크립트를 결합했지만 user79865의 스크립트와 같이 날짜를 입력하는 대신 하루를 선택할 수 있습니다.
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);
}
}
}
이 기능을 잠시 사용한 후에는 다음과 같은 몇 가지 문제점과 개선 사항이 있습니다.
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]);
}
}
}
}