Is there somewhere in the Admin where I can see if Reminders were sent for a late invoice? I see the original Email in my Sent folder in Gmail, but don’t see the reminders.
Also, is there any way to add more reminder types? I’d like to remind people that their due date is approaching, basically Due Date minus 3 days or something?
You can set any of the reminders to any number of days before/after either the due date or the invoice date.
So what you could do is set the first reminder to 3 days before the due date, then leave the second, third, and endless reminders as late notices.
As for seeing if the reminders were actually sent, I don’t think they put a logging option in. However, you could set the cron for
php artisan ninja:send-reminders to output to a log file.
m h dom mon dow <your/php/path>/php <your/ninja/path>/artisan ninja:send-reminders >> /path/to/logfile/filename.whatever
That would output to whatever file you specify, and append each time it ran (vs simply overwriting). Although what you’ll get is a generalized output rather than specifics. For example:
$DATE $TIME +0000 Running SendReminders...
$DATE $TIME +0000 $COUNT due recurring invoice instance(s) found
$DATE $TIME +0000 $COUNT accounts found with fees enabled
$DATE $TIME +0000 $COUNT accounts found with reminders enabled
$DATE $TIME +0000 $COUNT scheduled reports
$DATE $TIME +0000 Done
Thanks, Titanfall. I didn’t even see the dropdown for before/after.
I’d still love to add more, but I guess that’ll work for now.
I see a logging option in their docs, but only for Postmark, not for Gmail. Hopefully, that gets added soon. For now, I’ll use your suggestion.
I tried to manually run my reminders from the command line and got the error:
In Builder.php line 1229:
compact(): Undefined variable: operator
Anyone know if that means they’re not sending and how to fix it? A Google result points me to a post here citing PHP 7.3 isn’t supported, but I already downgraded Invoice Ninja to PHP 7.2 and don’t have any other issues.
Also, should this timestamp update when a Reminder is sent? https://take.ms/yu6iq (Don’t ask me how they viewed it a week before I sent it, I don’t care about that.)
I see the issue. The Cron is running as the default version of PHP (7.3) and failing.
Modifying my cron to
/usr/local/bin/php72 /home//public_html//artisan ninja:send-reminders did the trick by forcing it to run as PHP 7.2
And, yes, the “Time Sent” updates when a Reminder is sent. Phew.
PHP 7.3 is definitely the most likely culprit. Since you’re able to force it to use 7.2, you should be able to set the system-wide default back to that.
Assuming you’re using Ubuntu or similar,
sudo update-alternatives --config php will give you a menu of currently installed PHP versions to choose from. In my case, I get
user@host:~$ sudo update-alternatives --config php
There are 2 choices for the alternative php (providing /usr/bin/php).
Selection Path Priority Status
0 /usr/bin/php7.3 73 auto mode
* 1 /usr/bin/php7.2 72 manual mode
2 /usr/bin/php7.3 73 manual mode
Press <enter> to keep the current choice[*], or type selection number:
The Invoice Ninja install is running 7.2, but it looks like (at least on Centos), cron runs as the default version of PHP, which is 7.3 for us.
So forcing those cronjobs to run at 7.2 seems to have resolved the issue for me.
The install may still be using 7.3 if it’s the system-wide default (or Apache/nginx is set to it). The incompatibilities don’t seem to show themselves from the user’s perspective, but definitely do when running the crons, which is why I didn’t catch it at first on my own install. Might be worth double-checking.
I’m seeing reminders not sent unless I trigger the reminder script from Terminal.
It seems to be failing via Cron, but the command is identical.
Would the failed Cron be logged somewhere so I can look and see why it’s failing?
I found the issue and fixed my cron jobs.
I also triggered them manually, but they didn’t send the reminder that should have gone out. I’ll keep looking into why.