Try ERPNext Buy Support Partners Foundation

[Proposal] Issues with automatic contact creation for incoming e-mails

Hi everyone,
I’m in the process of setting up ERPNext for my company right now and ideally would want to use as many features as possible.

One of them is the email inbox, however, I have my issues with some of its functionality. To be more precise, I don’t like that ERPNext automatically creates contacts for new email addresses.

  1. The identification of the contact’s name doesn’t work well. Most of the time it ends up with setting “john.doe” as first name when the email address is “john.doe@example.com

  2. While searching for existing data with the respective email address, it only checks the contact email child table. However, contacts are not the only type of references. An email could also belong to a lead, an opportunity, an address, user, etc. Because it checks only in contacts, a lot of duplicates get created if you already have the email address saved in one of the mentioned doctypes.

  3. This point is closely related to the previous one. The assumption that all emails are sent by contacts is not reasonable. If the email address is something like “info@example”, then this should most likely not be saved as a contact, because a contact has to be a person (with first name and last name).

Because of this, the automatic contact creation leads to spamming in the contacts list with trash data most of the time in my opinion.

My proposal to solve this problem would be to turn off the automatic creation of contacts and instead make some sort of periodic check if an email can get linked to an existing contact, address, lead, opportunity, …, so that the timeline links are still all there if you add e.g. a contact with that email address afterwards.

What do you think? I’d love to hear your opinion. Maybe there is also someone who benefits from the automatic contact creation.

If you like the idea, I could contribute with a pull request.

I looked into the code a little bit this afternoon. What I had not thought of is that the script that links the communication docs to the contacts is inside frappe, but a lot of possible linkable doctypes are from erpnext, so it’s not possible to hard code these.

However, I created a prototype script for the matching process that accepts a dictionary of doctype and docfield for finding the linkable docs. This way, the script can be dynamically loaded with the desired doctypes.

My idea would be to create a communication settings doctype with a child table which holds the doctypes and docfields that get looked up by the script. Thus, custom apps can also extend the functionality to new doctypes.
Furthermore, on the communication settings page could also be a checkbox for enabling or disabling automatic creation of contacts.

Same observations and nice elaboration of problem agreed to improvement

1 Like