質問編集履歴
1
コード修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
htmlに埋め込まれたグーグルフォームの内容をgmail
|
1
|
+
htmlに埋め込まれたグーグルフォームの内容をgmailに送れるようにしたい。
|
test
CHANGED
@@ -6,16 +6,12 @@
|
|
6
6
|
|
7
7
|
```html
|
8
8
|
|
9
|
-
<
|
10
|
-
|
11
|
-
<form class="py-1" action="https://docs.google.com/forms/u/0/d/e/1FAIpQLSeuT2jVDunRtbFBIKawF6KNUlx_QPfW_OXfdic2UHp6twMFlw/formResponse" method="post" name="contact_form" target="hidden_iframe" onsubmit="submitted=true;">
|
9
|
+
<form class="py-1" action="https://docs.google.com/forms/u/0/d/e/1FAIpQLSeuT2jVDunRtbFBIKawF6KNUlx_QPfW_OXfdic2UHp6twMFlw/formResponse" method="post" name="contact_form" target="hidden_iframe" onsubmit="submitted=true;">
|
12
10
|
|
13
11
|
<div class="box mt-10" style="display:inline-block">
|
14
12
|
|
15
13
|
<p class="ask-form border-success mt-10">問合せフォーム</p>
|
16
14
|
|
17
|
-
|
18
|
-
|
19
15
|
</div>
|
20
16
|
|
21
17
|
<dl>
|
@@ -110,13 +106,13 @@
|
|
110
106
|
|
111
107
|
|
112
108
|
|
113
|
-
<dd class="ml-4 freebirdFormviewerComponentsQuestionBaseRoot">
|
109
|
+
<dd class="interest ml-4 freebirdFormviewerComponentsQuestionBaseRoot">
|
114
|
-
|
110
|
+
|
115
|
-
<input class="ak" name="entry.118592182" type='checkbox'>
|
111
|
+
<input class="ak" name="entry.118592182" type='checkbox'>チェック1
|
116
|
-
|
112
|
+
|
117
|
-
<input class="ht" name="ht" type='checkbox' value='ht'>
|
113
|
+
<input class="ht" name="ht" type='checkbox' value='ht'>チェック2
|
118
|
-
|
114
|
+
|
119
|
-
<input class="ks" type='checkbox' value='ks'>
|
115
|
+
<input class="ks" type='checkbox' value='ks'>チェック3
|
120
116
|
|
121
117
|
</dd>
|
122
118
|
|
@@ -128,14 +124,8 @@
|
|
128
124
|
|
129
125
|
</dt>
|
130
126
|
|
131
|
-
|
132
|
-
|
133
127
|
<dd><textarea name="entry.839337160" class="form-control col-6 offset-1 quantumWizTextinputPapertextareaInput exportTextarea" id="request" cols="30" rows="10"></textarea></dd>
|
134
128
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
129
|
</dt>
|
140
130
|
|
141
131
|
</dl>
|
@@ -160,7 +150,9 @@
|
|
160
150
|
|
161
151
|
<option value="meeting">C</option>
|
162
152
|
|
163
|
-
<option value="consultation">D
|
153
|
+
<option value="consultation">D
|
154
|
+
|
155
|
+
</option>
|
164
156
|
|
165
157
|
</select>
|
166
158
|
|
@@ -168,8 +160,6 @@
|
|
168
160
|
|
169
161
|
|
170
162
|
|
171
|
-
|
172
|
-
|
173
163
|
<dd>
|
174
164
|
|
175
165
|
<hr class="d-none d-lg-block mb-0 ml-0" />
|
@@ -182,140 +172,104 @@
|
|
182
172
|
|
183
173
|
</label>
|
184
174
|
|
185
|
-
|
186
|
-
|
187
175
|
</dd>
|
188
176
|
|
189
177
|
</form>
|
190
178
|
|
191
|
-
|
192
|
-
|
193
|
-
</div>
|
194
|
-
|
195
179
|
```
|
196
180
|
|
197
181
|
google apps script
|
198
182
|
|
199
183
|
```
|
200
184
|
|
201
|
-
function submitForm(e){
|
185
|
+
function submitForm(e) {
|
202
|
-
|
186
|
+
|
203
|
-
var itemResponses = e.response.getItemResponses();
|
187
|
+
var itemResponses = e.response.getItemResponses();
|
204
|
-
|
188
|
+
|
205
|
-
var message = '';
|
189
|
+
var message = '';
|
206
|
-
|
190
|
+
|
207
|
-
var username = '';
|
191
|
+
var username = '';
|
208
|
-
|
192
|
+
|
209
|
-
var mail = '';
|
193
|
+
var mail = '';
|
210
|
-
|
194
|
+
|
211
|
-
for (var i = 0; i < itemResponses.length; i++) {
|
195
|
+
for (var i = 0; i < itemResponses.length; i++) {
|
212
|
-
|
196
|
+
|
213
|
-
var itemResponse = itemResponses[i];
|
197
|
+
var itemResponse = itemResponses[i];
|
214
|
-
|
198
|
+
|
215
|
-
var question = itemResponse.getItem().getTitle();
|
199
|
+
var question = itemResponse.getItem().getTitle();
|
216
|
-
|
200
|
+
|
217
|
-
var answer = itemResponse.getResponse();
|
201
|
+
var answer = itemResponse.getResponse();
|
218
|
-
|
202
|
+
|
219
|
-
if (question == '会社名'){
|
203
|
+
if (question == '会社名') {
|
220
|
-
|
204
|
+
|
221
|
-
company= answer;
|
205
|
+
company = answer;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
if (question == 'メールアドレス') {
|
210
|
+
|
211
|
+
mail = answer;
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
if (question == '氏名') {
|
216
|
+
|
217
|
+
username = answer;
|
218
|
+
|
219
|
+
}
|
220
|
+
|
221
|
+
if (question == '電話番号') {
|
222
|
+
|
223
|
+
phone = answer;
|
224
|
+
|
225
|
+
}
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
if (question == 'ご興味のあるサービス') {
|
230
|
+
|
231
|
+
interest = answer;
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
message += (i + 1).toString() + '. ' + question + ': ' + answer + '\n';
|
238
|
+
|
239
|
+
}
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
var address = '@gmail.com'; //メールアドレス
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
//自分宛てのメール
|
248
|
+
|
249
|
+
//タイトル
|
250
|
+
|
251
|
+
var title = '新規問合せ';
|
252
|
+
|
253
|
+
var content = 'に新規問合せが入りました。\n\n' + message;
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
GmailApp.sendEmail(address, title, content);
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
//登録者あてのメール
|
262
|
+
|
263
|
+
var title2 = 'お問合せありがとうございます。'; //メールのタイトル
|
264
|
+
|
265
|
+
var content2 = company + ' ' + username + '様\n' +
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
GmailApp.sendEmail(mail, title2, content2);
|
222
270
|
|
223
271
|
}
|
224
272
|
|
225
|
-
if (question == 'メールアドレス'){
|
226
|
-
|
227
|
-
mail = answer;
|
228
|
-
|
229
|
-
}
|
230
|
-
|
231
|
-
if (question == '氏名'){
|
232
|
-
|
233
|
-
username = answer;
|
234
|
-
|
235
|
-
}
|
236
|
-
|
237
|
-
if (question == '電話番号'){
|
238
|
-
|
239
|
-
phone = answer;
|
240
|
-
|
241
|
-
}
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
if (question == 'ご興味のあるサービス'){
|
246
|
-
|
247
|
-
ak = answer;
|
248
|
-
|
249
|
-
}
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
message += (i + 1).toString() + '. ' + question + ': ' + answer + '\n';
|
254
|
-
|
255
|
-
}
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
var address = 'n@gmail.com'; //★あなたのメールアドレス
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
//自分宛てのメール
|
264
|
-
|
265
|
-
//タイトル
|
266
|
-
|
267
|
-
var title = '新規問合せ';
|
268
|
-
|
269
|
-
var content = 'に新規問合せが入りました。\n\n' + message;
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
GmailApp.sendEmail(address, title, content);
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
//登録者あてのメール
|
278
|
-
|
279
|
-
var title2 = 'お問合せありがとうございます。'; //メールのタイトル
|
280
|
-
|
281
|
-
var content2 = company+' '+username + '様\n'
|
282
|
-
|
283
|
-
+ 'です。\n'
|
284
|
-
|
285
|
-
+ '\n'
|
286
|
-
|
287
|
-
+ 'この度はお問い合わせありがとうございます。\n'
|
288
|
-
|
289
|
-
+ '\n'
|
290
|
-
|
291
|
-
+ '\n'
|
292
|
-
|
293
|
-
+ '後ほど担当者より連絡差し上げますので今しばらくお待ちください。\n'
|
294
|
-
|
295
|
-
+'------------------------------------\n'
|
296
|
-
|
297
|
-
+'株式会社,,,\n'
|
298
|
-
|
299
|
-
+ ' \n'
|
300
|
-
|
301
|
-
+ '\n'
|
302
|
-
|
303
|
-
+ '\n'
|
304
|
-
|
305
|
-
+ '———————–\n'
|
306
|
-
|
307
|
-
+ '\n'
|
308
|
-
|
309
|
-
+ '\n'
|
310
|
-
|
311
|
-
+ '\n'
|
312
|
-
|
313
|
-
+ '———————–\n';
|
314
|
-
|
315
|
-
GmailApp.sendEmail(mail, title2, content2);
|
316
|
-
|
317
|
-
}
|
318
|
-
|
319
273
|
|
320
274
|
|
321
275
|
```
|