Sending emails - auto send invoices

Hello

I have an interesting peroblem that needs fixing.

ERPNext sends the invoices just fine to th eperson designated as the primary contact email for the account.

But, an interesting issue has arisen. When a new client has a primary contact with the same first name as a contact of a pre-existing client, the invoice is sent to the pre-existing client contact with the same name.

It just happens to the third same first name.

If I manually send it from with in erpnext, no problem. Also, if 3 primary email contacts from 3 different companies exist, it sends it to the first one that was entered.

Can anyone shed light on why after seeing the first name of a companies contact that erpnext would try to find a previous existing primary contact email with the same first name?

Thanks

Joseph

@smokinjo

It looks like you are using process statement of account doctype to send ledgers / aging to your customers.

You can customize contact doctype where First Name has to be Unique so that every time a contact is created for any master record will have unique First Name.

You can also use Notification Module to trigger emails based on primary contact person email addresses dynamically.

Hi

hanks for the idea.

I rhought about it, and my comment/question to that idea is:

The contact who is supposed to get the invoice is linked to that client. Why is another clients contact getting an email? Is erpnext not smart enough to use it’s c clients contact, and not the contact of another client? Is that not why a contact is linked to a client?

On top of that, one contact that received someones invoice was the contact of a supplier. YIkes.

I would like to think that erpnext respects the clients and the contacts connected to it.

Ideas/comments?

Thanks

Joseph