/** * UNIT TES SCRIPT SEBELUM JALAN DI Production * * NOTE: Minimal Harus ada satu input pada form agar test-unit ini dapat berjalan * Copyright 2022 By eFBe - https://nogino.my.id and Source Script From https://yagisanatode.com */ function testAndAuthScope(){ const form = FormApp.getActiveForm(); const formResponses = form.getResponses(); // const responses = e.response; const responses = formResponses[2];//This changes from the event (e) response to the first one called in the form. 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(); //cek kategori as active or passive participant const kategori = responses.getItemResponses()[5].getResponse(); //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: "760018104@mail.unej.ac.id", subject: "Your registration for The 1st ICMP has been successfully submitted", htmlBody: `
|