since one of the last versions we have a problem with recurring invoices. We have a client with two contacts and when the next invoice is due, only one of the contacts gets an e-mail with the invoice.
Both of the contacts are activated in the edit screen of the recurring invoice, so both should get an e-mail.
The activity log only shows that an e-mail was sent to contact 1, but contact 2 actually got the mail.
We tried this with two different recurring invoices (and two different clients).
It seems that the contact where client_contacts.id = client_contacts.client_id and client_contacts.is_primary = true doesn’t get the mail. But this might be just a coincidence…
Any idea why this could happen? Is there a new setting that we have to activate to send an e-mail to all the contacts? Or did something change in the last versions?
Do you know which of the e-mails should get sent first? Maybe our mailserver is taking too long and the app is running into a timeout?
(Also, an old footer text was used, that is nowhere present in any of the current settings. It only occurs in the older invoices that were created from the same recurring invoices. But this is maybe unrelated.)
Nothing has changed around this part of the application for quite some time.
We use the invoice invitations to determine which contacts should receive the email. If you indirect that table and find the associated invoice invitations there should be more information on the sent date columns
The table invoice_invitations shows all the client_contacts but sent_date and email_status are NULL, and email_error is empty. At least for the newest entries (where we had the problems).
Is this OK like that?
SELECT i.number, i.status_id, i.last_sent_date, iin.client_contact_id, iin.invoice_id, iin.email_error,
iin.sent_date, iin.created_at, iin.deleted_at, iin.email_status, cc.send_email, cc.is_primary
FROM invoice_invitations iin, invoices i, client_contacts cc
WHERE iin.invoice_id = i.id AND iin.client_contact_id = cc.id
AND i.status_id != 1 AND iin.created_at > str_to_date(‘01.04.2023’, ‘%d.%m.%Y’)
ORDER BY iin.created_at desc;
(We also just switched to daylight savings time recently but that probably should not be a problem, apart from maybe having the email sent an hour later...)
select client_id, client_contact_id, invoice_id, activity_type_id, is_system, token_id
from activities where invoice_id in (702, 685, 672) order by created_at desc;