I have a custom function that forwards specific e-mails to my todo list application. Unfortunately, the e-mail message content (which shows up as the todo's note text) is forwarded as raw html, making it near impossible to read.
I'd like to convert the message content as plaintext (stripping out / removing all the html) before sending. Here's my current function:
messageDetails = zoho.mail.getMessage(mail_messageId);
mailContent = messageDetails.get("CONTENT");
mailSubject = messageDetails.get("SUBJECT");
// Set folder, med priority and status
mailSubject = mailSubject + " *inbox ! $Planning";
// Remove unneeded text from subject line
mailSubject = mailSubject.replaceAll("Fw: ","");
mailSubject = mailSubject.replaceAll("FW: ","");
mailSubject = mailSubject.replaceAll("Fwd: ","");
mailSubject = mailSubject.replaceAll("FWD: ","");
mailSubject = mailSubject.replaceAll("Re: ","");
mailSubject = mailSubject.replaceAll("RE: ","");
// Convert mailContent to plain text before sending HERE
sendmail
[
from :zoho.adminuserid
to :----forwarding e-mail address goes here---
subject :mailSubject
message :mailContent
]