To retrieve the html content from the email body we can use the function: getHtmlBody()

Returns a string that represents the HTML content included in the body field of an email message sent to an Email Capture plug-in implementation. Returns null if there is no HTML content in the body of the email message.
For example, this method returns null if the body of an email message contains plain text with no formatting.