0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

返信用メールが途中でおかしくなってしまいました

Last updated at Posted at 2018-11-18

グーグルフォームで下記のスクリプトを使っています。

50件ぐらいはうまく動いていたのですが、
途中で返信用メールが一定の人にまとめて届くようになり、
一旦削除して作り直してみたら、
今度は全く返信用メールが届かなくなりました。

途中でそういうことが起こるものなんですか?
違う場所で聞いたら下記のは良くないソースだと言われましたが、
コピーして使っているので、
よくわかりません。

聞き方も伝わるのかどうかわかりませんが、
内容すらよく理解せずに使っているので、
申し訳ありません。

どなたか教えてください。

function autoreply()
{

var title = "医療";
var body
= "お申込みありがとうございます。\n"
+"【セミナー名】医療\n"
+"【日時】 2018年12月12日(水) 9:30開場\n"
+"      10:00~16:00\n"
+"【会場】 AP大阪大阪東梅田\n"
+"【住所】 大阪市北区堂山町3−3 日本生命梅田ビル\n"
+"【道順】 地下街泉の広場から「M-10」階段を昇り、右側へ昇り、そのまま道沿いです\n"
+"【参加費】2,000円\n"
+"【お問い合わせ先】 東/aaaaa@gmail.com\n"
+"\n"
+"      \n"
+"下記の通りお申込みを受け付けました\n\n"

  • "------------------------------------------------------------\n" ;
    var footer
    = "------------------------------------------------------------\n\n"
  • "お問い合わせメール:aaaaa@gmail.com"
  • "ありがとうございました";

var name = 'お名前';
var mail = 'メールアドレス';
var address = "";

var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getLastRow();
var cols = sheet.getLastColumn();
var rg = sheet.getDataRange();
Logger.log("rows="+rows+" cols="+cols);

for (var i = 1; i <= cols; i++ ) {
var col_name = rg.getCell(1, i).getValue();
var col_value = rg.getCell(rows, i).getValue();
body += "■"+col_name+"\n";
body += col_value + "\n\n";
if ( col_name === mail ) {
body = col_value+" 様\n\n"+body;
}
if ( col_name === mail ) {
address = col_value;
}
}
body += footer;

GmailApp.sendEmail(address,title,body);
}

0
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?