質問編集履歴
5
ソースコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,17 +12,109 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
|
15
|
+
ソースコードは以下になります。
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
+
|
20
|
+
|
19
|
-
|
21
|
+
【マニフェスト】
|
20
22
|
|
21
23
|
|
22
24
|
|
23
|
-
|
25
|
+
{
|
24
26
|
|
27
|
+
"timeZone": "GMT",
|
28
|
+
|
29
|
+
"oauthScopes": [
|
30
|
+
|
31
|
+
"https://www.googleapis.com/auth/gmail.addons.execute",
|
32
|
+
|
25
|
-
https://
|
33
|
+
"https://www.googleapis.com/auth/gmail.addons.current.message.readonly",
|
34
|
+
|
35
|
+
"https://www.googleapis.com/auth/spreadsheets",
|
36
|
+
|
37
|
+
"https://www.googleapis.com/auth/script.storage"
|
38
|
+
|
39
|
+
],
|
40
|
+
|
41
|
+
"gmail": {
|
42
|
+
|
43
|
+
"version": "TRUSTED_TESTER_V2",
|
44
|
+
|
45
|
+
"name": "Expense It!",
|
46
|
+
|
47
|
+
"logoUrl": "https://www.gstatic.com/images/icons/material/system/1x/receipt_black_24dp.png",
|
48
|
+
|
49
|
+
"contextualTriggers": [{
|
50
|
+
|
51
|
+
"unconditional": {
|
52
|
+
|
53
|
+
},
|
54
|
+
|
55
|
+
"onTriggerFunction": "getContextualAddOn",
|
56
|
+
|
57
|
+
"openLinkUrlPrefixes": [
|
58
|
+
|
59
|
+
"https://docs.google.com/"
|
60
|
+
|
61
|
+
],
|
62
|
+
|
63
|
+
}],
|
64
|
+
|
65
|
+
"primaryColor": "#41f470",
|
66
|
+
|
67
|
+
"secondaryColor": "#94f441"
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
【GetContextualAddOn.js】
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
function getContextualAddOn(event) {
|
84
|
+
|
85
|
+
var message = getCurrentMessage(event);
|
86
|
+
|
87
|
+
var prefills = [getReceivedDate(message),
|
88
|
+
|
89
|
+
getLargestAmount(message),
|
90
|
+
|
91
|
+
getExpenseDescription(message),
|
92
|
+
|
93
|
+
getSheetUrl()];
|
94
|
+
|
95
|
+
var card = createExpensesCard(prefills);
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
return [card.build()];
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
function getCurrentMessage(event) {
|
108
|
+
|
109
|
+
var accessToken = event.messageMetadata.accessToken;
|
110
|
+
|
111
|
+
var messageId = event.messageMetadata.messageId;
|
112
|
+
|
113
|
+
GmailApp.setCurrentMessageAccessToken(accessToken);
|
114
|
+
|
115
|
+
return GmailApp.getMessageById(messageId);
|
116
|
+
|
117
|
+
}
|
26
118
|
|
27
119
|
|
28
120
|
|
4
タグの変更
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
3
タグを削除しました
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
タグを削除しました
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
tagを追加しました。
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|