EDIT UPDATED ANSWER:
I looked at your script more carefully. It's using a different function called createDraft(). It's not actually sending any emails, it's just created Drafts that you can send later. No problem. Here's the documentation for createDraft. createDraft can ALSO use "htmlBody" as a replacement parameter for the message body. That's what we'll do...
In your script code, change this:
// Create the email draft
GmailApp.createDraft(
config[emailField], // Recipient
emailSubjectUpdated, // Subject
emailBody // Body
);
to this:
// Create the email draft
GmailApp.createDraft({
to: config[emailField], // Recipient
subject: emailSubjectUpdated, // Subject
htmlBody : emailBody // Body
});
As long as your "emailBody" variable content is in html, your email draft should be saved as html tool.
But there's the rub. It's not trivial to convert a Google Document into a pure HTML file without additional external libraries. One solution is simply to forgo a Google Document, and create a real html file inside your script, and use that as your emailBody variable. HERE'S AN EXAMPLE implementation of this solution.
ORIGINAL ANSWER:
The script you linked to didn't appear to include the actual mail sending function. I wrote a script a while ago (for a spreadsheet) that automatically creates an email based on rows of a spreadsheet, and the email is composed with "rich" html.
Here's the mail sending function:
function sendEmail(to,sub,mes) {
var t = "";
var s = "";
var m = "";
sub == null || sub == undefined || sub == "" ? s = "Subject Failed" : s = sub;
mes == null || mes == undefined || mes == "" ? m = "Message Failed!" : m = mes;
to == null || to == undefined || to == "" ? t = "[email protected]" : t = to;
MailApp.sendEmail({to: t, subject: s, htmlBody: m});
}
In this function, I pass in a few variables (the recipient "to", the subject "sub", and the message body "mes") and I make sure the function still works even if any of the variables are for some reason blank. The "mes" is my message body, and it's a string that's written in html. This is all just how I draft the email. You can simplify this greatly if you want (I'll include a simplified version below).
The part that matters is the final line MailApp.sendEmail({to:t,subject:s,htmlBody: m}); PAY PARTICULAR ATTENTION to the "htmlBody" part. If the sendEmail function doesn't have "htmlBody" as the property name for your message body, then it will just send it in plain text. You'll likely just need to find the function that has the "MailApp.sendEmail()" function in it, and adjust it to include the "htmlBody" property name for your message body.
Here's that function simplified:
function sendEmail(recipient, sub, mes) {
MailApp.sendEmail({to: recipient, subject: sub, htmlBody: mes});
}
To read about all the options for sending email using Google Apps Script, read this page.