// returns our final email, will error on gmail max attachments > 25mb
// a lot of hardwired html in here.. but it could be worse.
function sendNotification(theemailsubject, fromemail, toemail, attachmentFiles, emailbody) {
Logger.log("sending email now");
GmailApp.sendEmail(toemail, theemailsubject, '', {
replyTo: fromemail,
htmlBody: emailbody,
attachments: attachmentFiles
} )
}
function createEmailBody(inboundEmailBody,
documentNames,
documentDescriptions,
emaillinks,
emaillinknames,
emaillinkdetails) {
var outboundEmailBody = inboundEmailBody.replace(/\n/g, '
');
if(emaillinks.length > 0) {
}
if(emaillinks[0].length > 0) {
outboundEmailBody += createLinkTable(emaillinks, emaillinknames, emaillinkdetails);
}
if(documentNames[0].length > 0) {
outboundEmailBody += `
List of files attached here individually or as a zip file:
`;
for (var i in documentNames) {
outboundEmailBody += "" + documentNames[i] + " - ";
outboundEmailBody += documentDescriptions[i];
outboundEmailBody += "
";
}
}
outboundEmailBody += `
This email was generated with Google Workspace and the Appsheet no-code platform.
Name | Details |
" + emaillinknames[i] + " | "; finallinktable += "" + emaillinkdetails[i] + " |