I'm using the following SuiteScript to send personalized emails to contacts:
var emailBody = nlapiMergeRecord(emailTemplateID,'contact',contact_id).getValue(); nlapiSendEmail(senderID,emailTo,emailSubject,emailBody);
emailTemplateID allows me to choose from one of six different templates, in siz different languages. As such the subject of the email needs to change too, depending on the emailTemplateIDCurrently I'm using the JavaScript 'swtich' command to work out the ID, and set the 'emailSubject' variable approriately, e.g.switch (emailTemplateID) { case 1: emailSubject = "Communities"; break; case 2: emailSubject = "Communautés"; break; }The issue is that in case 2, the subject needs to contain a non-English character, e, but when the email is recieved the character is replaced with '�'.My udnerstanding is that is because of character sets - potentially UTF8 vs ISO-8859-1. Whatever the cause, I need to resolve this.Now, the body of the email I send, by using 'nlapiMergeRecord' to get it from the e-mail template, also includes non-English characters, but they come through correctly. So, my question is.. can i get the Subject from the email template as well, so that I don't have to hard-code it in my SuiteScript .js file?