Search code examples
google-apps-scriptgmail

Gmail apps script getBody/getPlainBody without signature?


I'm calling messages[j].getPlainBody(); to output the body of an email and log it in a spreadsheet. I want to log the plain text of the email - not the signature, footer etc from the email. How can I do this?

I notice in Gmail there's a sort of tab that hides my signature when I'm writing/viewing emails - can I access this programmatically somehow to achieve the above?


Solution

  • The Gmail UI intelligently collapses the messages to hide previous messages or signatures. There is no way to do this in the API. You can log an enhancement request here - https://code.google.com/p/google-apps-script-issues/issues/list