retrive beans from email

Hi to all, i got an array of mail. They are from leads, and i need to check if i have already this lead or not. Is there a way to find a bean Lead from an email?

thanks

sorry i meant to vote you up, not down! I can’t figure out how to undo it yet

Where there is a will, there is a way! Even if it requires custom coding. So much groundwork has already been laid to make that easier!

But, what do you mean by retrieving beans by email? You should be able to search by email manually already if leads is enabled in global search

example, i recive a json in post with an email. I need to check if there is already a lead with that email. How?

By receiving a JSON in email do you mean you are recieving a web-based form lead object from a third-party website?
If that is the case, why receive by email what you could be receiving and processing in SuiteCRM?
Personally I’d probably prefer a custom script to parse the object and input the lead in the CRM and get it there, where you can use Workflow etc and keep all the history together.

Ok i think i’m not good to exsplain my problem. i try to be more detailed.

I have a 2b2(ecommerce) and when someone subscribe in newsletter, contact or event form, it’s saved on a db table.

3 times at day starts a cronjob where those users are submitted with a json in my entrypoint of the crm. I need to save those users as lead, but there are the possibility a user registered in contacts AND newsletter with the same email, and i don’t want 2 leads, but just 1 leads with the udpated data. So the “unique key” is the email. I need to know if there is a way, with beans metod to check if there is already a lead with that email. That’s all

This might help:

https://community.sugarcrm.com/thread/26948

You should probably search the email_addresses table, either with direct SQL (or from the Beans, if you find a way to do it) and then work backwards from there to see if it is related to a Lead record in “email_addr_bean_rel” table.

Avoid just looking at the “email1” field because that is just a proxy for the primary email, but doesn’t contain the full list of multiple email addresses that can be associated with a record.

Hi, So when an incoming mail comes you want to verify it first whether it is an existing contact or not am i right?

Exactly, and i wished there was a good way to do it, instead of direct query de db with some joins