Recurring invoice is sent to only one of the client contacts

Hello,

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.)

Hi,

@david any thoughts?

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;

number;  status_id;  last_sent_date;  client_contact_id;  invoice_id;  email_error;  sent_date;  created_at;      deleted_at; email_status; send_email; is_primary
R0902023;  2;      2023-04-04;           76;                702;             ;       NULL;  "2023-04-04 09:00:02.101614";  NULL;  NULL;     1;      0
R0902023;  2;      2023-04-04;           24;                702;             ;       NULL;  "2023-04-04 09:00:02.100318";  NULL;  NULL;     1;      1
R0892023;  2;      2023-04-04;           76;                685;             ;       NULL;  "2023-04-04 07:00:02.044614";  NULL;  NULL;     1;      0
R0892023;  2;      2023-04-04;           24;                685;             ;       NULL;  "2023-04-04 07:00:02.043346";  NULL;  NULL;     1;      1
R0862023;  2;      2023-04-03;           42;                672;             ;       NULL;  "2023-04-01 10:00:01.729555";  NULL;  NULL;     1;      0
R0862023;  2;      2023-04-03;           39;                672;             ;       NULL;  "2023-04-01 10:00:01.728223";  NULL;  NULL;     1;      1


(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...)

Are the clients or associated contacts marked as archived/deleted (deleted_at != null) ?

Is there any information in the System Logs or Activity logs

No nothing seems to be deleted or archived or anything.

SELECT id, is_deleted, deleted_at FROM clients WHERE id in (24, 39);

24 0 NULL
39 0 NULL

SELECT id, client_id, is_locked, send_email, deleted_at FROM client_contacts WHERE client_id in (24, 39);

24 24 0 1 NULL
76 24 0 1 NULL
39 39 0 1 NULL
42 39 0 1 NULL


System_logs table is empty.

Nothing suspicious in activity_log:

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;

client_id client_contact_id invoice_id activity_type_id is_system token_id
24 24 702 6 1
24 702 5 1
24 24 685 6 1
24 685 5 1
39 672 5 0 3
39 39 672 6 0 3
39 672 5 0 3
39 39 672 6 1
39 672 5 1

I am having the same issue. I don’t see any reason why it is not sending to additional contacts when using recurring invoicing.

Has this been solved?

When you view the recurring invoice are both contacts checked?

Thanks. Wow missed that.