Have the Lead Source change depending on the email's format that is received

Have the Lead Source change depending on the email's format that is received

Hi all.

We have leads coming to us from various websites. A user visits a website, submits their details via a form, which then sends us an email.

What we want to happen is for a new Lead record to be created and the Lead Source field automatically select which website that lead has come from.

(We have no control of the form code on these 3rd party websites, so we cant add any Zoho variables to the forms).

So what we need is some code to say "If email is received and contains the Subject line of 'enquiry from adverts.com' create a new Lead and assign 'adverts.com' as the Lead Source". We'll also need to somehow extract the name, email, phone, enquiry message from the email too and insert that into the lead.

Of course, the difficult thing is that all the emails will be formatted differently because their on various 3rd party websites.

How can this be achieved?

Thanks