Recurring Invoice & Reminder Emails Not Working But Others Are

Hello

I am set up with Self-Hosted v. 4.5.19. Great product! I created recurring invoices, and those emails are not being sent out to emails not on my server. I receive the bcc and I have checked quarantines on my test email accounts. The email is not being held, and looks not not sent out.

Are there detailed error logs that I can look at? Or set to be logged? I don’t see anything in the logs folder that is helpful as it stands now.

Or is there a setting other than the two cron jobs that I may have missed?

When I send the invoice manually, it does send. So this is odd.

Thanks

Can you check you haven’t disabled auto-email on Settings > Invoice Settings

Hi Hillel

In invoice settings, Auto Email is set to Enable.

To clarify… the recurring invoice is running (ie, the crons are enabled) and it is creating the standard invoice but the generated invoice isn’t being sent?

Is the generated invoice marked as sent or draft?

Crons are running. Email gets sent to my email address telling me that the recurring invoice is generated and sent.

Email does not get sent to client. Generated invoice is marked as sent.

Have you tried creating a recurring invoice using your own email as the client?

Yes, with my own email it is sent. It seems to be anything non on my server that is not sent. Which is odd as if I manually click send invoice it is sent to any email (i.e., not my local server email addresses to the actual client email).

You may want to try with a different email provider, I’m not sure it’s a problem with the app

Sorry you replied before I realized I had not finished and was editing my reply:

This is odd–if I manually click send invoice it is sent to any email (i.e., not my local server email addresses to the actual client email). So it seems to only be related to the recurring invoice creation. Which to me would not be an email provider issue.

Gotcha. The logs are in storage/logs/laravel-error.log but I’m not sure if they’ll help here.

Are you using Docker, maybe the cron is getting different environment variables?

There is nothing in the error logs that would point to any issues. Last error was from last week when I first set this up.

I’m just using a standard install, so not docker.

Cron Jobs are:

*/19 * * * * /usr/local/bin/php /path/to/artisan/artisan ninja:send-invoices

*/20 * * * * /usr/local/bin/php /path/to/artisan/artisan ninja:send-reminders

(times are adjusted for testing and path is adjusted for simplicity)

Did you use the System Settings UI or manually update the .env file? If you used the UI it’s worth checking the .env file is correct.

Hi yes, the env file looks correct.

Have you tried using your own email address when it’s run as a cron?

Yes, when I use an email address that is set up on the same server, the mail is delivered fine. When the address is not, say to O365, or gmail, it is not delivered.

I have tried sending it to my office 365 address, and by all indications it does not even try to deliver (looking at the quarantine logs there is nothing there).

However, when I click on “Send Invoice” it is delivered to any email address specified, which seems to indicate that it is not an email delivery problem, since it delivers to any email address, but something with the recurring invoice setup.

I am scratching my head trying to figure this one out.

Sorry, all I can suggest is to try with another email provider to see if it helps

I’ll give it a try and post my results here.

Thanks

So I tried to set the SMTP settings to my gmail account.

Ran the test email, email sent and received.

Set up a recurring invoice, and I have the same results:

  1. Email received advising that invoice sent
  2. BCC to my email - received email
  3. Client Email not received, no errors (and the client email was my gmail account being used to send out from with the test email working).

This is the same behaviour I was seeing earlier.

So, probably not email provider related.

Next steps?

Thanks!

Can you clarify, is #2 saying that the BCC received the email for the invoice? If that’s the case you can check the headers of the email to see that the to address was included.

The to address is included, and during the testing, only addresses that are on my server receive the recurring invoice.

Does not matter the domain.

Does not matter if I use smtp.gmail.com with my gmail settings, or my email setting associated with InvoiceNinja.

Any email that is not residing on the same server as my invoiceninja installation only receives email if manually sent. No matter the email service used. Recurring invoice emails are not sent. For example, I can look in my Office 365 quarantine queue and can verify that delivery was not attempted.

Any email that is residing on the same server as my invoiceninja installation receives email no matter if recurring or if manually sent. No matter the email service used.

So that still points at an issue local to InvoiceNinja to me.

Thanks again for the assistance, thoughts on next steps?