I created a custom script in ERPNext that sends an email with the Sales Invoice PDF to the customer when the invoice is submitted. It also adds the person who submitted the invoice in the CC.
The email from my script works fine — it has the correct subject, sender name, CC, and attached PDF.
But the problem is, two emails are being sent:
- One is the correct email from my custom script.
- The second one is a plain system-generated email without a PDF.
Why is this second email being sent?
How can I stop it so that only my custom email goes out?