Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Email Invoices and duplicate recipients

Started by David Wynn -   in API Endpoints

Hi Xero Developer Community,

When using the Invoices/{InvoiceID}/Email endpoint, we observe that the generated email will have the Contact's email address duplicated in the To: header under a very common set of conditions.

If the Contact name does not match the Primary Person's name, the Primary Person's email address will appear twice in the To: header, once with the Contact's name and once with the Primary Person's name.

For example:

Contact Name = 'Wynn Industries'.
Primary Person's FirstName = 'David', LastName = 'Wynn', Email = 'david@whatever.blah.co.nz'.

If I use the Invoices/{InvoiceID}/Email endpoint to send an Invoice to this contact, the To: header of the email will look like this:

To: David Wynn <david@whatever.blah.co.nz>, Wynn Industries <david@whatever.blah.co.nz>

Depending on the recipient's mail system, they may receive this email more than once in their inbox.

If the Contact's name is the same as the Primary Person's name, the recipient will only appear once.

We would prefer if our Contacts did not receive duplicate Invoice emails, without having to rename all their businesses.

Are we using Contacts wrong? Is there a workaround we can use to prevent this from happening? Will this be fixed in Xero?