You need to sign in to do that
Don't have an account?
Harvey Jethro
First column removed from attachment in Email to Case functionality
Hi All,
I created the Apex class below to create attachments using the blob class. The attachment are from the HTML version of emails.
I'm getting the attachemnts but the first coloum of the HTML table is removed.
Thanks!
Additionally,
I found out that I can parse incoming HTML email content from this link https://developer.salesforce.com/forums/?id=906F0000000934IIAQ.
The issue I'm having with this solution is that Blob will not accept array of strings.
I created the Apex class below to create attachments using the blob class. The attachment are from the HTML version of emails.
I'm getting the attachemnts but the first coloum of the HTML table is removed.
Thanks!
Additionally,
I found out that I can parse incoming HTML email content from this link https://developer.salesforce.com/forums/?id=906F0000000934IIAQ.
The issue I'm having with this solution is that Blob will not accept array of strings.
global class EmailtooCaseExample implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.Inboundenvelope env) { String myHtmlBody = email.HtmlBody; final String className = 'EmailtooCase'; String METHOD_NAME='handleInboundEmail'; String caseNum=''; String toAddress=''; String toAddresses=''; String ccAddresses=''; String forwardingEmails=''; String myBody = email.plainTextBody; Messaging.InboundEmailResult result = new Messaging.InboundEmailresult(); try{ Attachment newment = new Attachment( ParentId = '5XX77111116MqZqANK', Name = 'letstest.pdf', ContentType = 'application-pdf', Body = blob.topdf(email.HtmlBody)); Database.insert(newment); } catch(DmlException e) {System.debug('The following exception has occurred: ' + e.getMessage()); } return result; } }