You need to sign in to do that
Don't have an account?
Spencer Widman
APEX class to Parse email body to update fields on multiple contact records or Parse data in an attachment
I get sent emails with data in both the bodies and as a csv attachment with contact information that I need to update. Currently I use the dataloader or the data import wizard and manually upload the information into our Org. From the research I have done on the forums it appears that I can write an Apex class to parse the information from both the body of the email or an attachment and update the contact records with the appropriate information. Looking for some examples or resources to write this in Apex so that my external partners can email an address and have the data update in my organzation. Hopefully this makes sense on this post like it does in my head. Any information or references would be greatly appreciated.
This may help to get the ideas flowing:
Good luck.
-greg
First Name Last Name Email Created Date
Sean Sample sampleyahoo.com 8/1/2019
Stacey Sample sample2@outlook.com 7/31/2019
Rick Sample sample@hotmail.com 7/30/2019
Brian Sample sample@gmail.com 7/30/2019
Daniel Sample sample@gmail.com 7/30/2019
Asiel "Ace" Sample sample@gmail.com 7/29/2019
When the data is received as one of the two attachments the data is in standard spreadsheet form with header rows very similiar to the embedded. In all cases the contacts exist and just need to be updated. with the appropriate information in the various fields.
Does anyone have any ideas for resources that I could use specific to this use case or some sample code I might use to get going? The code Greg H posted looks to be exactly inline with what I need but due to my lack of experience I need some examples or resources to write the execution data. Thanks in advance for any help you all might have.
Cheers!
Spence
-greg