Skip to content

Instantly share code, notes, and snippets.

@ninokierulf
Last active June 25, 2021 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninokierulf/b5934076ac987cd7b05660885b78c69c to your computer and use it in GitHub Desktop.
Save ninokierulf/b5934076ac987cd7b05660885b78c69c to your computer and use it in GitHub Desktop.
Advanced Google Form

Sheets

  1. Form Responses 1
  2. PromoCodes
  3. Settings

Range Name

conf_email conf_columns

App Script (Tools > Script Editor)

  • Code.gs
  • Email.html
  • Email2.html

Triggers

  1. Add Trigger
  2. Choose which function to run: onFormSubmit
  3. Choose which deployment should run: Head
  4. Select event source: From spreadsheet
  5. Select event type: On Form Submit <-- IMPORTANT!
  6. Failure notification settings: Notify me daily
Email Email Placeholders
Subject [Natural] Promo code for you! y
Header Thank you {name}! y
Message We have something for you y
Promo description Here is your promo code: y
Promo code {promo_code} y
Button text Shop y
Button link https://naturalbrand.sg/ n
Button color (hex) #D83A56 n
Footer We appreciate you! y
Signature line 1 From y
Signature line 2 Amy Tng y
Signature line 3 (Pacesetters Organisation) y
Footer p1 If you have any questions - simply reply to this message y
Footer p2 We hope you liked our gift y
Footer p3 Have a great day! y
Footer p4 🎉🎉 y
Logo image https://naturalbrand.sg/wp-content/uploads/2015/12/Natural-Brand-logo.jpg n
Logo link https://naturalbrand.sg/ n
Logo alt Natural y
Key Column
column_name 2
column_email 4
column_timestamp 1
Placeholders
{name}
{email_address}
{promo_code}
{timestamp}
// This function will be called everytime the form is submitted.
function onFormSubmit(event) {
sendAutomatedEmail()
}
function globalVariables(){
var variables = {
sheetName_responses: 'Form Responses 1',
sheetName_promoCodes: 'PromoCodes',
sheetName_settings: 'Settings',
htmlName_email: 'Email.html',
rangeName_conf_email: 'conf_email',
rangeName_conf_columns: 'conf_columns'
};
return variables;
}
function sendAutomatedEmail() {
var global = globalVariables();
SpreadsheetApp.getActiveSpreadsheet().getSheetByName(global.sheetName_responses).activate();
var responseSheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var promocodeSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(global.sheetName_promoCodes);
var settingsSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(global.sheetName_settings);
var lastResponseRow = responseSheet.getLastRow(); // User which last filled the form
var promocodeTakenCol = getPromoCodesTakenCol();
var availablePromoRow = getFirstEmptyRowByColumnArray(promocodeTakenCol);
var conf_columns = getColumnsConf();
var timestamp = responseSheet.getRange(lastResponseRow, conf_columns.col_timestamp).getValue();
var name = responseSheet.getRange(lastResponseRow, conf_columns.col_name).getValue();
var email = responseSheet.getRange(lastResponseRow, conf_columns.col_email).getValue();
var duplicateEmailRow = getRowMatchingText(email, promocodeTakenCol);
var promoRow = availablePromoRow;
if (duplicateEmailRow >= 0) {
promoRow = duplicateEmailRow;
}
var availablepromocode = promocodeSheet.getRange(promoRow, 1).getValue();
var placeholders = [];
placeholders.push(["{timestamp}", timestamp]);
placeholders.push(["{name}", name]);
placeholders.push(["{promo_code}", availablepromocode]);
placeholders.push(["{email_address}", email]);
var conf_email = getEmailConf(placeholders)
var htmlBody = getEmailHtml(conf_email);
var body = constructEmailBody(conf_email);
console.log(conf_email);
try {
MailApp.sendEmail({
to: email,
subject: conf_email.subject,
body: body,
htmlBody: htmlBody
});
promocodeSheet.getRange(promoRow, 2).setValue(email);
}
catch(e) {
console.error("Failed: Sending email to " + email);
}
}
// MARK: PromoCodes
function getPromoCodesTakenCol() {
var spr = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(globalVariables().sheetName_promoCodes);
var column = spr.getRange('B:B');
var values = column.getValues();
return values;
}
// MARK: Settings
function getEmailConf(placeholders) {
var values = SpreadsheetApp.getActive().getSheetByName(globalVariables().sheetName_settings).getRange(globalVariables().rangeName_conf_email).getValues();
values.shift(); // Remove headers
var conf_email = {};
conf_email.subject = resolvePlaceholders(values[0][1], placeholders);
conf_email.header = resolvePlaceholders(values[1][1], placeholders);
conf_email.message = resolvePlaceholders(values[2][1], placeholders);
conf_email.promo_desc = resolvePlaceholders(values[3][1], placeholders);
conf_email.promo_code = resolvePlaceholders(values[4][1], placeholders);
conf_email.btn_text = resolvePlaceholders(values[5][1], placeholders);
conf_email.btn_link = values[6][1];
conf_email.btn_color = values[7][1];
conf_email.footer = resolvePlaceholders(values[8][1], placeholders);
conf_email.sig_l1 = resolvePlaceholders(values[9][1], placeholders);
conf_email.sig_l2 = resolvePlaceholders(values[10][1], placeholders);
conf_email.sig_l3 = resolvePlaceholders(values[11][1], placeholders);
conf_email.footer_p1 = resolvePlaceholders(values[12][1], placeholders);
conf_email.footer_p2 = resolvePlaceholders(values[13][1], placeholders);
conf_email.footer_p3 = resolvePlaceholders(values[14][1], placeholders);
conf_email.footer_p4 = resolvePlaceholders(values[15][1], placeholders);
conf_email.logo_image = values[16][1], placeholders;
conf_email.logo_link = values[17][1], placeholders;
conf_email.logo_alt = resolvePlaceholders(values[18][1], placeholders);
return conf_email;
}
function getColumnsConf() {
var values = SpreadsheetApp.getActive().getSheetByName(globalVariables().sheetName_settings).getRange(globalVariables().rangeName_conf_columns).getValues();
values.shift(); // Remove headers
var conf_columns = {};
conf_columns.col_name = values[0][1];
conf_columns.col_email = values[1][1];
conf_columns.col_timestamp = values[2][1];
return conf_columns;
}
// MARK: Email
function getEmailHtml(conf_email) {
var htmlTemplate = HtmlService.createTemplateFromFile(globalVariables().htmlName_email);
htmlTemplate.conf_email = conf_email;
var htmlBody = htmlTemplate.evaluate().getContent();
return htmlBody;
}
function constructEmailBody(conf_email) {
var body = "";
body = body + conf_email.header + "\n";
body = body + conf_email.promo_desc + conf_email.promo_code + "\n";
body = body + conf_email.btn_text + " " + conf_email.btn_link + "\n";
body = body + conf_email.footer + "\n";
body = body + "\n\n"
body = body + conf_email.sig_l1 + "\n";
body = body + conf_email.sig_l2 + "\n";
body = body + conf_email.sig_l3 + "\n";
return body;
}
// MARK: Helpers
/*
Don's array approach - checks first column only
With added stopping condition & correct result.
From answer https://stackoverflow.com/a/9102463/1677912
*/
function getFirstEmptyRowByColumnArray(columnValues) {
var values = columnValues;
var ct = 0;
while ( values[ct] && values[ct][0] != "" ) {
ct++;
}
return (ct+1);
}
function getRowMatchingText(text, columnValues) {
var values = columnValues;
for(var i = 0; i<values.length;i++){
if((values[i][0]+"").toUpperCase() === text.toUpperCase()) {
return i+1;
}
}
return -1;
}
function resolvePlaceholders(text, placeholders) {
var returnText = text + "";
for(var i = 0; i<placeholders.length; i++){
returnText = returnText.replace(placeholders[i][0], placeholders[i][1]);
}
return returnText;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE�ge">
<!--<![endif]-->
<meta name="viewport" content="width�vice-width, initial-scale=1.0">
<meta name="format-detection" content="telephone=no">
<meta name="x-apple-disable-message-reformatting">
<title><?= conf_email.subject ?></title>
<style type="text/css">
@media screen {
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: local("Fira Sans Regular"), local("FiraSans-Regular"), url(https://fonts.gstatic.com/s/firasans/v8/MIPWVWI_mY_QERxcMVPEwIX0hVgzZQUfRDuZrPvH3D8.woff2) format("woff2");
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: local("Fira Sans Regular"), local("FiraSans-Regular"), url(https://fonts.gstatic.com/s/firasans/v8/EjsrzDkQUQCDwsBtLpcVQZBw1xU1rKptJj_0jans920.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: local("Fira Sans Medium"), local("FiraSans-Medium"), url(https://fonts.gstatic.com/s/firasans/v8/zM2u8V3CuPVwAAXFQcDi4IjoYw3YTyktCCer_ilOlhE.woff2) format("woff2");
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: local("Fira Sans Medium"), local("FiraSans-Medium"), url(https://fonts.gstatic.com/s/firasans/v8/zM2u8V3CuPVwAAXFQcDi4Bampu5_7CjHW5spxoeN3Vs.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 700;
src: local("Fira Sans Bold"), local("FiraSans-Bold"), url(https://fonts.gstatic.com/s/firasans/v8/DugPdSljmOTocZOR2CItOojoYw3YTyktCCer_ilOlhE.woff2) format("woff2");
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 700;
src: local("Fira Sans Bold"), local("FiraSans-Bold"), url(https://fonts.gstatic.com/s/firasans/v8/DugPdSljmOTocZOR2CItOhampu5_7CjHW5spxoeN3Vs.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 800;
src: local("Fira Sans ExtraBold"), local("FiraSans-ExtraBold"), url(https://fonts.gstatic.com/s/firasans/v8/htOw9f-chtELyJuFCkCrFojoYw3YTyktCCer_ilOlhE.woff2) format("woff2");
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 800;
src: local("Fira Sans ExtraBold"), local("FiraSans-ExtraBold"), url(https://fonts.gstatic.com/s/firasans/v8/htOw9f-chtELyJuFCkCrFhampu5_7CjHW5spxoeN3Vs.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
}
@media screen and (max-width: 525px) {
.cta_style_1 .cta__title {
font-size: 24px !important;
line-height: 1.42 !important;
}
.cta_style_1 .cta__title br,
.cta_style_1 .cta__text br {
display: none !important;
}
.menu_style_6 .menu__inner {
padding: 25px 20px !important;
}
.block_style_2 .block__box {
padding: 25px 20px !important;
}
.footer_style_6 .footer__inner {
padding: 25px 20px !important;
}
}
@media screen and (max-width: 620px) {
.menu_style_6 .menu__inner {
padding-right: 30px !important;
padding-left: 30px !important;
}
.cta-block_style_2 .cta-block__box {
padding: 35px 30px !important;
}
.footer_style_6 .footer__inner {
padding-right: 30px !important;
padding-left: 30px !important;
}
.content {
padding: 0 10px !important;
}
.container {
padding: 0 !important;
width: 100% !important;
}
}
</style>
</head>
<body style="font-family: 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 16px; width: 100% !important; Margin: 0; padding: 0; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; background-color: #F1F1F1;">
<table class="body" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #F1F1F1;" width="100%" bgcolor="#F1F1F1">
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">&nbsp;</td>
<td class="container" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 0 10px; display: block; max-width: 620px; width: 620px; Margin: 0 auto !important;" width="620" valign="top">
<div class="content" style="box-sizing: border-box; display: block; max-width: 620px; Margin: 0 auto;">
<table class="spacing spacing_h_20" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 0; height: 20px; font-size: 20px; line-height: 20px;" valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
<table class="menu menu_style_6" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td class="menu__inner" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 40px 40px 36px; background-color: #ffffff;" valign="top" bgcolor="#ffffff">
<table style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td class="menu__logo" align="center" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 0 10px; width: 150px;" width="150" valign="top">
<table class="logo logo_menu-6" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: auto;">
<tr>
<td class="logo__inner" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top; text-align: center;" valign="top" align="center">
<a class="logo__link" href="<?= conf_email.logo_link ?>" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; color: #1595E7; text-decoration: none; border: 0; outline: 0;">
<img src="<?= conf_email.logo_image ?>" class="logo__img" alt="<?= conf_email.logo_alt ?>" style="outline: none; max-width: 100%; border: 0; Margin: 0; text-decoration: none; line-height: 100%; height: auto; -ms-interpolation-mode: bicubic; display: block; font-weight: 700; font-size: 22px; color: #1B1B1B; width: 130px;"
width="130">
</a>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="cta-block cta-block_style_2" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td class="cta-block__box" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 42px 40px 41px 40px; background-color: #ffffff;" valign="top" bgcolor="#ffffff">
<table class="cta cta_style_1 cta_center" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; text-align: center;"
width="100%" align="center">
<tbody>
<tr>
<td class="cta__title" style="-webkit-text-size-adjust: 100%; box-sizing: border-box; -ms-text-size-adjust: 100%; padding: 0; vertical-align: top; color: #151515; font-size: 36px; font-weight: 900; line-height: 1.28; letter-spacing: -.6px; font-family: 'Fira Sans', Helvetica, Arial, sans-serif;"
valign="top"><?= conf_email.header ?></td>
</tr>
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">
<table class="spacing spacing_h_10" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 0; height: 10px; font-size: 10px; line-height: 10px;" valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="cta__text cta__text_style_2" style="-webkit-text-size-adjust: 100%; box-sizing: border-box; -ms-text-size-adjust: 100%; padding: 0; vertical-align: top; letter-spacing: -.2px; font-size: 20px; font-weight: 300; line-height: 1.4; color: #1B1B1B; font-family: 'Fira Sans', Helvetica, Arial, sans-serif;"
valign="top">
<?= conf_email.promo_desc ?>
<span class="text-bold" style="font-weight: bold;"><?= conf_email.promo_code ?></span>
</td>
</tr>
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">
<table class="spacing spacing_h_20" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 0; height: 20px; font-size: 20px; line-height: 20px;" valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="cta__action" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">
<table class="btn btn_primary" cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;"
width="100%">
<tr>
<td align="center" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">
<table cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: auto;">
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top; background-color: <?= conf_email.btn_color ?>; border-radius: 8px; text-align: center;" valign="top" bgcolor="<?= conf_email.btn_color ?>" align="center">
<a href="<?= conf_email.btn_link ?>" style="-webkit-text-size-adjust: 100%; box-sizing: border-box; outline: 0; -ms-text-size-adjust: 100%; text-decoration: none; border: solid 1px <?= conf_email.btn_color ?>; border-color: <?= conf_email.btn_color ?>; display: inline-block; margin: 0; color: #ffffff; border-radius: 8px; background-color: <?= conf_email.btn_color ?>; line-height: 1.5; font-family: 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 500; cursor: pointer; padding: 13px 17px;">
<?= conf_email.btn_text ?>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="footer footer_style_6" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td class="footer__inner" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 40px 40px 41px; background-color: #ffffff;" valign="top" bgcolor="#ffffff">
<table style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td align="center" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">
<table class="text-block text-block_style_2 text-block_grey text-block_footer-6" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: auto;">
<tbody>
<tr>
<td class="text-block__text" style="-webkit-text-size-adjust: 100%; box-sizing: border-box; -ms-text-size-adjust: 100%; padding: 0; vertical-align: top; font-family: 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.43; letter-spacing: -.2px; color: #9B9B9B; text-align: center;"
valign="top" align="center">
<?= conf_email.footer ?>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="footer__inner" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 40px 40px 41px; background-color: #ffffff;" valign="top" bgcolor="#ffffff">
<table style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td align="left" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">
<table class="text-block text-block_style_2 text-block_grey text-block_footer-6" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: auto;">
<tbody>
<tr>
<td class="text-block__text" style="-webkit-text-size-adjust: 100%; box-sizing: border-box; -ms-text-size-adjust: 100%; padding: 0; vertical-align: top; font-family: 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.43; letter-spacing: -.2px; color: #9B9B9B; text-align: left;"
valign="top" align="left">
<?= conf_email.sig_l1 ?>
</td>
</tr>
<tr>
<td class="text-block__text" style="-webkit-text-size-adjust: 100%; box-sizing: border-box; -ms-text-size-adjust: 100%; padding: 0; vertical-align: top; font-family: 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.43; letter-spacing: -.2px; color: #9B9B9B; text-align: left;"
valign="top" align="left">
<?= conf_email.sig_l2 ?>
</td>
</tr>
<tr>
<td class="text-block__text" style="-webkit-text-size-adjust: 100%; box-sizing: border-box; -ms-text-size-adjust: 100%; padding: 0; vertical-align: top; font-family: 'Fira Sans', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.43; letter-spacing: -.2px; color: #9B9B9B; text-align: left;"
valign="top" align="left">
<?= conf_email.sig_l3 ?>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="spacing spacing_h_20" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; border-collapse: collapse !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tbody>
<tr>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; vertical-align: top; padding: 0; height: 20px; font-size: 20px; line-height: 20px;" valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</td>
<td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; box-sizing: border-box; padding: 0; vertical-align: top;" valign="top">&nbsp;</td>
</tr>
</table>
</body>
</html>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
<!--[if !mso]><!-- -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
#outlook a { padding: 0; }
.ReadMsgBody { width: 100%; }
.ExternalClass { width: 100%; }
.ExternalClass * { line-height:100%; }
body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
table, td { border-collapse:collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
img { border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; }
p { display: block; margin: 13px 0; }
</style>
<!--[if !mso]><!-->
<style type="text/css">
@media only screen and (max-width:480px) {
@-ms-viewport { width:320px; }
@viewport { width:320px; }
}
</style>
<!--<![endif]-->
<!--[if mso]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if lte mso 11]>
<style type="text/css">
.outlook-group-fix {
width:100% !important;
}
</style>
<![endif]-->
<!--[if !mso]><!-->
<link href="https://d2yjfm58htokf8.cloudfront.net/static/fonts/averta-v2.css" rel="stylesheet" type="text/css">
<style type="text/css">
@import url(https://d2yjfm58htokf8.cloudfront.net/static/fonts/averta-v2.css);
</style>
<!--<![endif]-->
<style type="text/css">
u + .body-wrapper a {
color: inherit;
text-decoration: none;
font-size: inherit;
font-family: inherit;
font-weight: inherit;
line-height: inherit;
}
p, ul {
margin: 0 0 24px 0;
}
a {
color: #00b9ff;
}
a.no-decoration {
text-decoration: none;
}
hr {
margin: 32px 0;
border-top: 1px #e2e6e8;
}
dt {
font-size: 13px;
margin-left: 0;
}
dd {
color: #37517e;
margin-bottom: 24px;
margin-left: 0;
}
h5 {
font-family: TW-Averta-SemiBold, Averta, Helvetica, Arial;
font-size: 16px;
line-height: 24px;
color: #2e4369;
}
pre {
display: block;
padding: 16px;
padding: 12px 24px;
margin: 0 0 48px;
font-size: 14px;
line-height: 24px;
color: #37517e;
word-break: break-all;
word-wrap: break-word;
white-space: normal;
background-color: #f2f5f7;
border-radius: 3px;
}
pre.code {
font-weight: bold;
text-align: center;
font-size: 18px;
letter-spacing: 5px;
}
.body-wrapper {
background: #f2f5f7 url('https://d2yjfm58htokf8.cloudfront.net/static/images/background-v1.png') no-repeat center top;
padding: 0px;
margin: auto;
}
.content-wrapper {
max-width: 536px !important;
padding: 32px;
padding-bottom: 48px;
}
.footer-wrapper div {
color: #5d7078 !important;
}
.footer-wrapper div a {
color: #00b9ff !important;
}
.hero {
font-family: TW-Averta-Bold, Averta, Helvetica, Arial;
color: #37517e;
font-size: 22px;
line-height: 30px;
}
.page-header {
border-bottom: 1px solid #eaebed;
padding-bottom: 16px;
}
.mb-0 {
margin-bottom: 0 !important;
}
.mt-0 {
margin-top: 0 !important;
}
.center {
text-align: center;
}
.btn {
box-sizing: border-box;
display: inline-block;
min-height: 36px;
padding: 12px 24px;
margin: 0 0 24px;
font-size: 16px;
font-weight: 600;
line-height: 24px;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: 0;
border-radius: 3px;
color: #fff !important;
background-color: #00b9ff;
text-decoration: none;
-webkit-transition: all .15s ease-in-out;
-o-transition: all .15s ease-in-out;
transition: all .15s ease-in-out;
}
.btn:hover {
background-color: #00a4df;
}
.btn:active {
background-color: #008ec0;
}
@media screen and (min-width: 576px) and (max-width: 768px) {
.body-wrapper {
padding: 24px !important;
}
.content-wrapper {
max-width: 504px !important;
padding: 48px !important;
}
}
@media screen and (min-width: 768px) {
.body-wrapper {
padding: 48px !important;
}
.content-wrapper {
max-width: 456px !important;
padding: 72px !important;
padding-top: 48px !important;
}
}
</style>
<style type="text/css">
@media only screen and (min-width:480px) {
.mj-column-per-100 { width:100%!important; }
}
</style>
</head>
<body>
<div class="mj-container body-wrapper">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;background:#fff;" class="content-wrapper" data-class="content-wrapper">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;background:#fff;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width:600px;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:middle;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:middle;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" style="vertical-align:middle;" width="100%" border="0">
<tbody>
<tr>
<td style="word-wrap:break-word;font-size:0px;padding:0px;" align="center">
<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0px;" align="center" border="0">
<tbody>
<tr>
<td style="width:150px;"><img alt="<?= conf_email.logo_alt ?>" height="auto" src="<?= conf_email.logo_image ?>" style="border:none;border-radius:0px;display:block;font-size:13px;outline:none;text-decoration:none;width:100%;height:auto;"
width="150"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
<tr>
<td style="width:600px;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="word-wrap:break-word;font-size:0px;padding:0px;">
<div style="font-size:1px;line-height:48px;white-space:nowrap;"> </div>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
<tr>
<td style="width:600px;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="word-wrap:break-word;font-size:0px;padding:0px;" align="left">
<div style="cursor:auto;color:#5d7079;font-family:TW-Averta-Regular, Averta, Helvetica, Arial;font-size:16px;line-height:24px;letter-spacing:0.4px;text-align:left;">
<p><?= conf_email.header ?></p>
<p class="hero">
<?= conf_email.message ?>
</p>
<p><?= conf_email.promo_desc ?></p>
<pre class="code">
<?= conf_email.promo_code ?>
</pre>
<p>
<?= conf_email.footer ?>
</p>
<p class="mb-0">
<a href="<?= conf_email.btn_link ?>" class="btn">
<?= conf_email.btn_text ?>
</a>
</p>
<hr style="margin-top: 56px">
<p class="mb-0"><?= conf_email.sig_l1 ?></p>
<p class="mb-0"><?= conf_email.sig_l2 ?></p>
<p class="mb-0"><?= conf_email.sig_l3 ?></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;" class="content-wrapper-outlook footer-wrapper-outlook">
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;" class="content-wrapper footer-wrapper">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width:600px;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="word-wrap:break-word;font-size:0px;padding:0px;" align="center">
<div style="cursor:auto;color:#5d7079;font-family:TW-Averta-Regular, Averta, Helvetica, Arial;font-size:14px;line-height:24px;letter-spacing:0.4px;text-align:center;"><?= conf_email.footer_p1 ?></div>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
<tr>
<td style="width:600px;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="word-wrap:break-word;font-size:0px;padding:0px;">
<div style="font-size:1px;line-height:24px;white-space:nowrap;"> </div>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
<tr>
<td style="width:600px;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="word-wrap:break-word;font-size:0px;padding:0px;" align="center">
<div style="cursor:auto;color:#5d7079;font-family:TW-Averta-Regular, Averta, Helvetica, Arial;font-size:10px;line-height:24px;letter-spacing:0.4px;text-align:center;">
<p class="mb-1"><?= conf_email.footer_p2 ?></p>
<p class="mb-1"><?= conf_email.footer_p3 ?></p>
<p class="mb-0"><?= conf_email.footer_p4 ?></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;background:transparent;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;background:transparent;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr class="zendesk-tag">
<td style="word-wrap:break-word;font-size:0px;padding:0px;" align="left">
<div style="cursor:auto;color:#f2f5f7;font-family:TW-Averta-Regular, Averta, Helvetica, Arial;font-size:1px;line-height:24px;letter-spacing:0.4px;text-align:left;"></div>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
<div style="margin:0px auto;max-width:600px;background:transparent;">
<table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;background:transparent;" align="center" border="0">
<tbody>
<tr>
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0px;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align:top;width:600px;">
<![endif]-->
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="word-wrap:break-word;font-size:0px;padding:0px;" align="center">
<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0px;" align="center" border="0">
<tbody>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</div>
</body>
</html>