how to count the number of emails for one lead

Hi,
I’m trying to find how to get the number of emails a sales sent for a lead/buyer.
I tried to find the foreign key in the table emails for lead_id but I can’t find anything so then I can execute my query.
Thanks to let me know if you have any idea where to find this link between both tables!

Hi,
I’m using Kreports Module for this purpose.

It’s free for basic packages, just google it.

And what I’m doing is:
Make a new report for Module: Emails:Contacts.
Select the fields you need to see.
Union select Module:Emails:Leads.

Find some tutorials if you’re confused, it’s easy to use.
And check out the attached pictures which showing how I did this.

Hope it’s helping. Good luck.

Thanks, unfortunately, I can’t upload this module (I have a “413, entity too large” error an I spent the morning debugging this with no luck)