回答編集履歴

2

a

2020/01/16 19:01

投稿

papinianus
papinianus

スコア12705

test CHANGED
@@ -36,7 +36,7 @@
36
36
 
37
37
  })).reduce(function (a, c) {
38
38
 
39
- return a.concat(c.map(mailToString))
39
+ return a.concat(c.map(function(e) { return mailToString(e, from); }))
40
40
 
41
41
  }, []).forEach(function (s) {
42
42
 
@@ -48,7 +48,7 @@
48
48
 
49
49
 
50
50
 
51
- function mailToString(m) {
51
+ function mailToString(m, from) {
52
52
 
53
53
  return "メール通知\nFrom:" + from + "\nTo:" + mailAddress + "\n日付:" + Utilities.formatDate(m.getDate(), 'Asia/Tokyo', 'yyyy/MM/dd HH:mm') + "\n件名:" + m.getSubject() + "\n" + m.getPlainBody();
54
54
 

1

a

2020/01/16 19:01

投稿

papinianus
papinianus

スコア12705

test CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  const now = new Date();
30
30
 
31
- const border = (new Date()).setMinutes(now.getMinutes() - quarter).getTime();
31
+ const border = (new Date()).setMinutes(now.getMinutes() - quarter);
32
32
 
33
33
  GmailApp.getMessagesForThreads(GmailApp.search(searchQuery).filter(function (th) {
34
34