回答編集履歴
2
回答を追記
test
CHANGED
@@ -7,3 +7,61 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
[http://www.googleappsscript.info/2017-07-25/send_email.html#tocAnchor-1-5](http://www.googleappsscript.info/2017-07-25/send_email.html#tocAnchor-1-5)
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
---
|
14
|
+
|
15
|
+
追記
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
質問に掲載のコードをベースにすると以下のような感じです。(該当箇所のみ)
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
```
|
24
|
+
|
25
|
+
//createTemplateFromFile に修正
|
26
|
+
|
27
|
+
var template = HtmlService.createTemplateFromFile("HTMLメール");
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
//データ(各行)に対して繰り返し
|
32
|
+
|
33
|
+
datas.forEach(function(data){
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
try{
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
var category = data[0];
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
var recipient = data[1];
|
46
|
+
|
47
|
+
var cc = data[2];
|
48
|
+
|
49
|
+
var bcc = data[3];
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
var subject = data[4];
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
//data(配列)をHTML側へ展開してから getContent
|
58
|
+
|
59
|
+
template.data = data;
|
60
|
+
|
61
|
+
var html = template.evaluate().getContent();
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
var body = html;
|
66
|
+
|
67
|
+
```
|
1
リンクを修正
test
CHANGED
@@ -6,4 +6,4 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
[http://www.googleappsscript.info/2017-07-25/send_email.html](http://www.googleappsscript.info/2017-07-25/send_email.html)
|
9
|
+
[http://www.googleappsscript.info/2017-07-25/send_email.html#tocAnchor-1-5](http://www.googleappsscript.info/2017-07-25/send_email.html#tocAnchor-1-5)
|