You need to sign in to do that
Don't have an account?
Staci
parse an email
I need to be able to parse the body of an external email to create a record in one of our custom objects.
I don't want the entire body in one field. The current email has fields like DESCRIPTION, RISK, ETC
Is there a way to "find" these headers somehow in the email and pop the info into certain field in SF?
Thanks!
Where is this email body located? If you are writing an email service, you have the entire body in one field, If you are trying to pull info out of the Description field from a Case (for instance), you'll have to write a trigger to get the contents and parse out what you need into other Case fields.
Hi JeffM
I have an email service set up and an apex class started to recieve the email and sort out the to/from/subject part, but when I got to the part in the instructions about the body it said you can put it in a note field. I need to be able to separate out the body of the email we get into different fields.
How would I write that trigger? Do you have an example?
In your email service class, you can use the properties of the Messaging.InboundEmail to get the plainTextbody as a string, then parse the string as needed.
You can parse through the email body as required. But warning it will not be foolproof.
Assumptions
1) You have a fixed pattern for the incoming email
2) You are willing to custom code and parse through the string
you could then use String Methods : http://goo.gl/c7NY3
to parse away all the details you require.
Thanks
go to Salesforce.com help section and find the Messaging.InboundEmailService