T.L Aparati Servis d.o.o - By Tagliasacchi


T.L Aparati Servis d.o.o
Vai ai contenuti

Ticket Richiesta Assistenza














T.L Aparati Servis d.o.o - By Tagliasacchi Leonardo
2 /****************************************************************************************** * Sends HTML email to user who has not completed task. * The HTML template is created from the email.html file. * * @param {array} overDueStaff - 2d array of overdue staff with full row data. * @param {string} sheetURL - url of current Spreadsheet. * @param {date} dateDue - formatted date. * * @return {array} - Returns array of email addresses that could not be attemplted due to errors. */ function sendEmail(overDueStaff, sheetURL, dateDue){ //Staff Details var staff = { "name": overDueStaff[0], "email": overDueStaff[1], "dueDate": dateDue, "daysOverdue": overDueStaff[4] }; staff.daysOverdue = (staff.daysOverdue > 1) ? staff.daysOverdue + " days" : staff.daysOverdue + " day"; //Setup embedded image. var imageURL = "https://drive.google.com/uc?id="+imgID; var badgerBlob = UrlFetchApp .fetch(imageURL) .getBlob() .setName("badgerBlob"); var body = HtmlService.createTemplateFromFile("email"); body.name = staff.name; body.due = staff.dueDate; body.overdue = staff.daysOverdue; body.reportName = sheetName; try{ MailApp.sendEmail({ to: staff.email, subject: subject, htmlBody: body.evaluate().getContent(), inlineImages: { badger: badgerBlob } }); } catch(error){ return staff.email; } };
Copyright 2020 T.L Aparati Servis d.o.o - Partita Iva/OIB: 01066429305 - Phone: +385(0)955740487 - email: tlaparatiservis@gmail.com - By Tagliasacchi Leonardo

Torna ai contenuti