Reminders are not sent

Hi

I’m having problems with sending reminders. In the invoices list I see that the ‘last reminder date’ is today, but no reminders are send. I have no problems with sending new invoices or recurring invoices.

When I log the cron tasks, I see this:

[2021-12-15T09:00:01+00:00] Running scheduled command: App\Jobs\Util\ReminderJob
[2021-12-15T09:00:01+00:00] Running scheduled command: App\Jobs\Cron\RecurringInvoicesCron
[2021-12-15T09:00:01+00:00] Running scheduled command: Callback
[2021-12-15T09:00:01+00:00] Running scheduled command: ‘/usr/bin/php7.4’ ‘artisan’ queue:restart > ‘/dev/null’ 2>&1
[2021-12-15T09:01:01+00:00] Running scheduled command: ‘/usr/bin/php7.4’ ‘artisan’ queue:work > ‘/dev/null’ 2>&1

I use supervisor, but I don’t think that that is responsible for sending invoices. At least, supervisor workers are running:

laravel-worker:laravel-worker_00 RUNNING pid 3903353, uptime 0:02:41
laravel-worker:laravel-worker_01 RUNNING pid 3903367, uptime 0:02:40
laravel-worker:laravel-worker_02 RUNNING pid 3903354, uptime 0:02:41

I’m using v5.3.35-C68, but had the same problem in 5.3.34.

Any idea where to start?

Hi,

@david any thoughts to debug?

@KrisL

So reminders work in a similar fashion to Recurring Invoices.

If Recurring is firing then the crons won’t be the issue.

One thing to check, in the Reminder setup page - do you have Send Email turned on?

Yes, ‘Send Email’ is turned on for the first, second, third and endless reminders.

Can you go to Clients, click to edit the client and check if Send Reminders is enabled?

@david I don’t see a place in Settings where I can set a default for this for newly created clients.

Hmm I see. See the screenshot below. The last option ‘Verstuur herinneringen’ is the ‘Send reminders’ option. For all clients this is ‘blank’, no option is chosen. I don’t know what the value of this option was in the past. At least, I didn’t changed this manually.

When this is blank, I would assume that the global setting would be in place. Just like the ‘quote valid until’ and the ‘invoice payment terms’ settings.

image

@xoo

I don’t think there is a way to do this unless you create a group setting and then apply the group to the client on creation if you have a standard set of settings

@KrisL

In the invoices table, can you confirm that a next_send_date is being generated for your invoices? This will tell us whether the system is actually calculating the reminder date.

In the invoice table I see the date of ‘Last reminder’ and ‘Next reminder’.
But no reminders were sent on December 15, 14, 11 or 8.

image

Are there any messages on those dates in the activities/system logs table?

The column is updated when only the reminder is “fired”.

In the ‘activities’, I see some logs about expenses.

image

And in the ‘system log’ some PDF creations of recurring invoices.

image

@KrisL

I’m not sure what we are missing here…

Can you advise the full settings you have for your reminders, i’ll write some tests to try and recreate.

Do you mean the reminder settings like this?

First reminder - 3 days - after due date - send email = yes
Second reminder - 8 days - after due date - send email = yes
Third reminder - 14 days - after due date - send email = yes
Endless reminders - weekly - send email = yes

Btw, in the supervisor worker log, I get this:

[2021-12-17 05:00:05][2061] Processing: App\Jobs\Util\ReminderJob
[2021-12-17 05:00:06][2061] Processed: App\Jobs\Util\ReminderJob
[2021-12-17 06:00:02][2062] Processing: App\Jobs\Util\ReminderJob
[2021-12-17 06:00:02][2062] Processed: App\Jobs\Util\ReminderJob
[2021-12-17 08:00:04][2064] Processing: App\Jobs\Util\ReminderJob
[2021-12-17 08:00:04][2064] Processed: App\Jobs\Util\ReminderJob
[2021-12-17 09:00:05][2065] Processing: App\Jobs\Util\ReminderJob
[2021-12-17 09:00:05][2065] Processed: App\Jobs\Util\ReminderJob

@KrisL

Do you have EXPANDED_LOGGING=true set in your .env file? If no, please turn this on as it will give us more information as to what is happening here.

If you do have it, please inspect the invoiceninja.log file you should see some entries like this:

Sending invoice reminders
Firing reminder email for invoice

Please report those back here.

I’ve put EXPANDED_LOGGING=true now in the .env file.

For unknown reason, this morning (19/12) two reminders were sent. Both reminders are ‘first reminders’. Nothing changed on the configuration, I’m even still on v5.3.35-C68. Both actions are also logged in the activities logs table.

image

@KrisL

Ok, let us know over the coming days whether the reminders are firing on schedule.

Hi

In the last week, some first and second reminders were sent successful.
Today some reminders are sent and not sent.

One reminder for a ‘second reminder’ was sent successful.
Two ‘endless reminders’ were not sent.

From the invoiceninja.log file:

[2021-12-28 06:00:01] production.INFO: 2021-12-28 Sending Recurring Invoices. Count = 0
[2021-12-28 06:00:04] production.INFO: Sending invoice reminders 2021-12-28 06:00:04
[2021-12-28 06:00:04] production.INFO: settings endless reminder
[2021-12-28 06:00:04] production.INFO: settings endless reminder
[2021-12-28 06:00:04] production.INFO: subject = settings var
[2021-12-28 06:00:05] production.INFO: Firing reminder email for invoice [invoice number second reminder here]
[2021-12-28 06:00:05] production.INFO: settings reminder 3 after_due_date
[2021-12-28 06:00:05] production.INFO: settings endless reminder
[2021-12-28 06:00:05] production.INFO: trying to send to [email address here] 2021-12-28 06:00:05
[2021-12-28 06:00:05] production.INFO: Using mailer => smtp
[2021-12-28 06:00:06] production.INFO:
[2021-12-28 07:00:02] production.INFO: Sending recurring invoices 2021-12-28 07:00:02

So the problem seems to occur with the endless reminders.
All of these reminders are for the same client.

When I look in the SMTP logs, I can only find the email for the ‘second reminder’.

Thanks for the details!

cc @david

@KrisL

Was the second reminder sent on schedule? Within that invoice where the second reminder has been sent, if you inspect that row in the database there will be a next_send_date column, does that match the 3rd reminder schedule?

Eg. for one invoice with this issue:

Invoice date: 02/11
First reminder: 19/11 (sent)
Second reminder: 24/11 (sent)
Third reminder: 30/11 (sent)
Endless reminder: never sent (even though the setting is set is to ‘weekly’)

I see a column ‘latest reminder’ and a column ‘next reminder’. Both have dates. The value for ‘latest reminder’ is on 28/12 (but this one is not sent). Next reminder has value 03/01.