GScript-Mailer/AutoReplyGform.gs

265 lines
11 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 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: `<!DOCTYPE html>
<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<!--[if mso]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch><o:AllowPNG/></o:OfficeDocumentSettings></xml><![endif]-->
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css"/>
<!--<![endif]-->
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
}
a[x-apple-data-detectors] {
color: inherit !important;
text-decoration: inherit !important;
}
#MessageViewBody a {
color: inherit;
text-decoration: none;
}
p {
line-height: inherit
}
.desktop_hide,
.desktop_hide table {
mso-hide: all;
display: none;
max-height: 0px;
overflow: hidden;
}
@media (max-width:620px) {
.desktop_hide table.icons-inner {
display: inline-block !important;
}
.icons-inner {
text-align: center;
}
.icons-inner td {
margin: 0 auto;
}
.image_block img.big,
.row-content {
width: 100% !important;
}
.mobile_hide {
display: none;
}
.stack .column {
width: 100%;
display: block;
}
.mobile_hide {
min-height: 0;
max-height: 0;
max-width: 0;
overflow: hidden;
font-size: 0px;
}
.desktop_hide,
.desktop_hide table {
display: table !important;
max-height: none !important;
}
.row-1 .column-1 .block-4.heading_block h1 {
font-size: 24px !important;
}
}
</style>
</head>
<body style="background-color: transparent; margin: 0; padding: 0; -webkit-text-size-adjust: none; text-size-adjust: none;">
<table border="0" cellpadding="0" cellspacing="0" class="nl-container" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: transparent;" width="100%">
<tbody>
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="row row-1" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tbody>
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="row-content stack" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f9f9f9; color: #000000; width: 600px;" width="600">
<tbody>
<tr>
<td class="column column-1" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-weight: 400; text-align: left; padding-left: 10px; padding-right: 10px; vertical-align: top; padding-top: 5px; padding-bottom: 20px; border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px;" width="100%">
<table border="0" cellpadding="0" cellspacing="0" class="image_block block-2" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tr>
<td class="pad" style="width:100%;padding-right:0px;padding-left:0px;padding-top:60px;">
<div align="center" class="alignment" style="line-height:10px"><img class="big" src="https://icmp.farmasi.unej.ac.id/wp-content/uploads/sites/3/2022/08/kop_icmp_2022_png-1-1.webp" style="display: block; height: auto; border: 0; width: 580px; max-width: 100%;" width="580"/></div>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="divider_block block-3" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tr>
<td class="pad" style="padding-bottom:20px;padding-left:10px;padding-right:10px;padding-top:20px;">
<div align="center" class="alignment">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="20%">
<tr>
<td class="divider_inner" style="font-size: 1px; line-height: 1px; border-top: 3px solid #295D09;"><span></span></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="heading_block block-4" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tr>
<td class="pad" style="text-align:center;width:100%;">
<h1 style="margin: 0; color: #023b5c; direction: ltr; font-family: 'Lato', Tahoma, Verdana, Segoe, sans-serif; font-size: 28px; font-weight: 700; letter-spacing: normal; line-height: 120%; text-align: center; margin-top: 0; margin-bottom: 0;"><span class="tinyMce-placeholder">Registration Confirmation Message</span></h1>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="divider_block block-6" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tr>
<td class="pad" style="padding-bottom:35px;padding-left:10px;padding-right:10px;padding-top:30px;">
<div align="center" class="alignment">
</div>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="paragraph_block block-7" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; word-break: break-word;" width="100%">
<tr>
<td class="pad">
<div style="color:#023b5c;direction:ltr;font-family:'Lato', Tahoma, Verdana, Segoe, sans-serif;font-size:16px;font-weight:400;letter-spacing:0px;line-height:120%;text-align:left;mso-line-height-alt:19.2px;">
<p style="margin: 0; margin-bottom: 16px;"><strong>Dear ${title} ${firstname} ${lastname}</strong></p>
<p style="margin: 0; margin-bottom: 16px;">This email was sent in response to your registration at The 1st International Conference on Medicinal Plants (The 1st ICMP) which will be held on Friday-Saturday, 21st-22nd October 2022.</p>
<p style="margin: 0; margin-bottom: 16px;">The committee will verify your payment, please wait for our official letter stating that you already registered as participant for this conference.</p>
<p style="margin: 0; margin-bottom: 16px;">Should you have further inquiries, please feel free to contact us via email at <a href="mailto:icmp@unej.ac.id" style="text-decoration: underline; color: #8a3b8f;" target="_self" title="icmp@unej.ac.id">icmp@unej.ac.id</a> or <a href="https://icmp.farmasi.unej.ac.id/contact-us/" rel="noopener" style="text-decoration: underline; color: #8a3b8f;" target="_blank">contact person(Click here)</a></p>
<p style="margin: 0; margin-bottom: 16px;"> </p>
<p style="margin: 0; margin-bottom: 16px;">Greetings,</p>
<p style="margin: 0; margin-bottom: 16px;">Chairman,</p>
<p style="margin: 0; margin-bottom: 16px;"> </p>
<p style="margin: 0;">apt. Endah Puspitasari, M.Sc.</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="row row-2" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-position: center top;" width="100%">
<tbody>
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="row-content stack" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #fff7fb; color: #000000; width: 600px;" width="600">
<tbody>
<tr>
<td class="column column-1" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-weight: 400; text-align: left; background-color: #fcfcfc; border-bottom: 0px solid #D4F9EF; border-left: 0px solid #D4F9EF; border-right: 0px solid #D4F9EF; border-top: 0px solid #D4F9EF; padding-left: 25px; padding-right: 25px; vertical-align: top; padding-top: 45px; padding-bottom: 25px;" width="100%">
<table border="0" cellpadding="10" cellspacing="0" class="text_block block-1" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; word-break: break-word;" width="100%">
<tr>
<td class="pad">
<div style="font-family: sans-serif">
<div class="txtTinyMce-wrapper" style="font-size: 12px; mso-line-height-alt: 14.399999999999999px; color: #66787f; line-height: 1.2; font-family: Lato, Tahoma, Verdana, Segoe, sans-serif;">
<p style="margin: 0; font-size: 14px; text-align: center;">Copyright © 2022 . International Conference of Medicinal Plants</p>
</div>
</div>
</td>
</tr>
</table>
<table border="0" cellpadding="10" cellspacing="0" class="text_block block-2" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; word-break: break-word;" width="100%">
<tr>
<td class="pad">
<div style="font-family: sans-serif">
<div class="txtTinyMce-wrapper" style="font-size: 12px; mso-line-height-alt: 14.399999999999999px; color: #66787f; line-height: 1.2; font-family: Lato, Tahoma, Verdana, Segoe, sans-serif;">
<p style="margin: 0; font-size: 14px; text-align: center;"><a href="https://icmp.farmasi.unej.ac.id/contact-us/" rel="noopener" style="text-decoration: underline; color: #0068a5;" target="_blank">Contact Us</a>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="row row-3" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tbody>
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="row-content stack" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #000000; width: 600px;" width="600">
<tbody>
<tr>
<td class="column column-1" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-weight: 400; text-align: left; vertical-align: top; padding-top: 5px; padding-bottom: 5px; border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px;" width="100%">
<table border="0" cellpadding="0" cellspacing="0" class="icons_block block-1" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tr>
<td class="pad" style="vertical-align: middle; color: #9d9d9d; font-family: inherit; font-size: 15px; padding-bottom: 5px; padding-top: 5px; text-align: center;">
<table cellpadding="0" cellspacing="0" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tr>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><!-- End -->
</body>
</html>`,
});
};