回答編集履歴
2
typo
answer
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
```javascript
|
12
12
|
function sender() {
|
13
13
|
const dat = createRequiredBlob();
|
14
|
-
const
|
14
|
+
const blob = dat[0];
|
15
15
|
const param = dat[1];
|
16
16
|
const applicant = param["B2"]; // "B2"のところを※8で申請者の右に指定したセル番地にかえてください ※9
|
17
17
|
const to = ""; // あてさきに設定するアドレス(webmaseter@example.com) ※1
|
1
名前
answer
CHANGED
@@ -10,13 +10,17 @@
|
|
10
10
|
|
11
11
|
```javascript
|
12
12
|
function sender() {
|
13
|
-
const
|
13
|
+
const dat = createRequiredBlob();
|
14
|
+
const blog = dat[0];
|
15
|
+
const param = dat[1];
|
16
|
+
const applicant = param["B2"]; // "B2"のところを※8で申請者の右に指定したセル番地にかえてください ※9
|
14
17
|
const to = ""; // あてさきに設定するアドレス(webmaseter@example.com) ※1
|
15
18
|
MailApp.sendEmail({
|
16
19
|
to: to,
|
20
|
+
name: applicant, //fromの名前がかわるはず。
|
17
|
-
subject: "申請", // 件名 ※2
|
21
|
+
subject: "申請 (申請者:"+applicant +")", // 件名 ※2
|
18
22
|
body: "添付ファイルをご確認ください", // 本文 ※3
|
19
|
-
attachments: [blob.setName("休暇申請.pdf")] // ファイル名の変更可 ※4
|
23
|
+
attachments: [blob.setName("休暇申請("+applicant+").pdf")] // ファイル名の変更可 ※4
|
20
24
|
});
|
21
25
|
}
|
22
26
|
function createRequiredBlob() {
|
@@ -29,12 +33,13 @@
|
|
29
33
|
const temporary = Utilities.getUuid();
|
30
34
|
const ansSheet = spreadSheet.getSheetByName(answers);
|
31
35
|
const tempSheetName = copySheet(spreadSheet, template, temporary);
|
32
|
-
|
36
|
+
const param = buildFillinParam(getLastData(ansSheet));
|
37
|
+
fillIn(spreadSheet, tempSheetName, param);
|
33
38
|
SpreadsheetApp.flush();
|
34
39
|
const tempSheet = spreadSheet.getSheetByName(tempSheetName);
|
35
40
|
const blob = fetchBlob(spreadSheet.getId(), tempSheet.getSheetId());
|
36
41
|
spreadSheet.deleteSheet(tempSheet);
|
37
|
-
return blob;
|
42
|
+
return [blob,param];
|
38
43
|
}
|
39
44
|
|
40
45
|
function getLastData(spreadSheet) {
|