function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rachel JonesRachel Jones 

Extract and normalise inbound email service data

I have written and successuccefully tested an email service to create a lead record.  However we have a complex requirement.  We have 6 lead web providers, who will each have thier own format of email.  In addition, the email will contains up to 10 variations of a single SFDC picklist option.

Where do I start with this?

Many thanks in advance.
KevinPKevinP
I would organize your solution into a set of classes that extend a baseInboundEmailProvider class.

Your base class would provide the methods necessary to create and save leads regardless of their provider or picklist option.

Your individual classes, or (you could probably get away with just constructors) would handle determination of the lead provider and picklist data.
KevinPKevinP
Just realized you may be wanting to know how to determine picklist options etc. 

If you have the ability to do  so, set X-HEader options on your email and use them for logic flow.