From ff37685e9d8e991d4d2a4e887d930a7992ab1c41 Mon Sep 17 00:00:00 2001 From: Fiky B Date: Tue, 6 Sep 2022 09:29:57 +0700 Subject: [PATCH] Tambah AutoReply Google Form script --- AutoReplyGform | 265 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 AutoReplyGform diff --git a/AutoReplyGform b/AutoReplyGform new file mode 100644 index 0000000..0afc4d1 --- /dev/null +++ b/AutoReplyGform @@ -0,0 +1,265 @@ +/** + * AutoReply Reg. + * + * getItemResponses()[nomorlokasi-row] + * trim() ==> ambil kata pertama + * + * Copyright 2022 By eFBe - https://nogino.my.id and Source Script From https://yagisanatode.com + */ + +function onFormSubmit(e) { + + const responses = e.response; + const email = responses.getRespondentEmail().trim(); + const firstname = responses.getItemResponses()[0].getResponse(); + const lastname = responses.getItemResponses()[1].getResponse().trim(); + const title = responses.getItemResponses()[2].getResponse().trim(); + + //Check if the users just added their first name or full name. + //const firstName = (name.indexOf(" ") == -1)? name : name.substring(0,name.indexOf(" ")); + + //Grab the signature block of the sender's account. NOTE! Requires Gmail API Service to be activated. + var signature = Gmail.Users.Settings.SendAs.list("me").sendAs.filter((account) => { + if(account.isDefault){ + return true} + })[0].signature; + + MailApp.sendEmail({ + name: "ICMP", + to: email, + subject: "Your registration for The 1st ICMP has been successfully submitted", + htmlBody: ` + + + + + + + + + + + + + + + + + + + + + +`, + }); +}; \ No newline at end of file