I'm using Gmail apps script to forward emails with a certain label ... But I'd like to edit the body of the message prior to forwarding.
function fwdFB(){
var label = GmailApp.getUserLabelByName('fb');
var threads = label.getThreads();
for(var m in threads){
var messages = threads[m].getMessages();
for(var y in messages){ messages[y].forward('[email protected]',{from:'[email protected]'}) }
threads[m].moveToTrash();
}
}
I'm unclear as to how to insert the getBody() method to edit the message. (Specifically, I want to delete a certain HTML chunk from the message. It's the same chunk in each message.)