How to Automatically Link Emails Sent via Gmail/Outlook to Contact Activities in ERPNext?

Hi everyone,

I have configured my Gmail account in ERPNext and enabled email synchronization. I want to achieve the following functionality:

When I send an email directly via Gmail, if the recipient’s email address matches an existing contact in my ERPNext system, I want the email to automatically appear in the “Activities” section of that contact.

So far, I have:

  1. Configured my Gmail account in ERPNext under the Email Account settings.
  2. Enabled incoming and outgoing email synchronization.
  3. Verified that my contacts have their email addresses correctly entered in ERPNext.

However, emails sent via Gmail are not automatically linking to the contact’s activities in ERPNext.

Is there a built-in feature in ERPNext that supports this, or do I need to implement a custom solution to achieve this functionality? If a custom solution is required, could someone guide me on how to set it up effectively?

Any help or pointers would be greatly appreciated!

Thank you!