1 accounts found with reminders - But No Reminder Emails Are Sent...

Here’s what I see when I run the Cron Job manually.

***@*** [~]# /usr/local/bin/php /home/***/public_html/ninja/artisan ninja:send-reminders Thu, 21 Dec 2017 21:40:11 +0000 Running SendReminders... 1 accounts found with fees MyCompany: 1 invoices found Charge fee: 28 1 accounts found with reminders MyCompany: 1 invoices found Send email: 28 Done ***@*** [~]#

NOTE: EMAIL DRIVER: SMTP
I am able to send email from InvoiceNinja GUI using CLIENTS>INVOICE>EMAIL_INVOICE>SEND_EMAIL

I’m not sure, I’d suggest trying to send the invoice with id #28 directly in the app itself.

Also, are there any errors in the logs in storage/logs/laravel-error.log

No errors in the logs in storage/logs/laravel-error.log

Is the “invoice id #” the same as the “Invoice Number”?

If no, how would I lookup invoices by id #?

If yes, I don’t have any invoices with the “Invoice Number 28”, any suggestions?

-Thanks

Here’s a SQL query to find it: select invoice_number from invoices where id = 28;

Okay, found the “Invoice Number” of “invoice id #28”.

Went to the my self-hosted app of Invoice Ninja>Invoices>Invoice_Number>Email_Invoice>Email Sent and Received.

I’ve not had any problems manually sending emails, only difficulty has been auto sending via cron.

Any suggestions?

Thank you.

Are you using Docker, I’ve seen cases where the .env variables are used by the app but not the CLI commands.

Nope, I’m using Softaculous via CPanel.

Try uncommenting this line of code, running the command and then checking storage/logs/laravel-info.log for the message.

https://github.com/invoiceninja/invoiceninja/blob/master/app/Ninja/Mailers/Mailer.php#L53

Bye the way, thank you for the support, Invoice Ninja is amazing enough on it’s own, but knowledgeable and helpful support just makes me love what ya’ll are doing that much more, seriously thanks.

Okay back to this mailer…

I uncommented the code on Line 53: \Log::info("{$toEmail} | {$replyEmail} | $fromEmail");

Ran the Cron Job manually.

Checked “storage/logs/laravel-info.log”

And got this…

[2017-12-22 08:40:58] production.INFO: Clients_Emails@.com | My_Reply-to_Email@.com | From-Address@mydomain.com [] []
[2017-12-22 08:40:58] production.INFO: Reply-to_Email@.com | From-Address@mydomain.com | From-Address@mydomain.com [] []
[2017-12-22 08:41:05] production.INFO: Clients_Emails@
.com | My_Reply-to_Email@.com | From-Address@mydomain.com [] []
[2017-12-22 08:41:06] production.INFO: Reply-to_Email@
.com | From-Address@mydomain.com | From-Address@mydomain.com [] []
[2017-12-22 08:41:11] production.INFO: Clients_Emails@.com | My_Reply-to_Email@.com | From-Address@mydomain.com [] []
[2017-12-22 08:41:11] production.INFO: Reply-to_Email@***.com | From-Address@mydomain.com | From-Address@mydomain.com [] []

Maybe the CLI doesn’t have permission to write to the error log? Try running the artisan command as sudo and then check laravel-error.log.

Unfortunately, I confirmed with my hosting provider that my Shared Hosting Plan does not include SUDO access.

I did however, open up permissions for laravel-error.log and laravel-info.log to 777.

And then ran ARTISAN command again, but no change and no info created for laravel-error.log.

You could try adding calls to \Log::info in the handleSuccess and handleFailure methods of the file to see the result.

Just to clarify…since I’m terrible with PHP.

Add this “\Log::info”

To this file “/app/Ninja/Mailers/Mailer.php”

Under private function handleSuccess($response, $data)

Like this…

private function handleSuccess($response, $data)
    {
        if (isset($data['invitation'])) {
            $invitation = $data['invitation'];
            $invoice = $invitation->invoice;
            $messageId = false;
            \Log::info

And under private function handleFailure($exception)

Like this…

private function handleFailure($exception)
    {
        if (isset($_ENV['POSTMARK_API_TOKEN']) && method_exists($exception, 'getResponse')) {
            $response = $exception->getResponse();
            \Log::info

If not, could you please provide an example of the code, thanks again.

You’d need something like \Log::info(‘success’);

Added \Log::info('success'); to “/app/Ninja/Mailers/Mailer.php”

Like this…

private function handleSuccess($response, $data)
    {
        if (isset($data['invitation'])) {
            $invitation = $data['invitation'];
            $invoice = $invitation->invoice;
            $messageId = false;
            \Log::info('success');

Then checked “storage/logs/laravel-info.log”

Which showed this…

production.INFO: Clients_Emails@.com | My_Reply-to_Email@.com | From-Address@mydomain.com [] []
production.INFO: success [] []
production.INFO: Bcc_Email_Addr@.com | My_Reply-to_Email@.com | From-Address@mydomain.com [] []

Any suggestions?

I’m not sure… can you check the email logs to see if it’s sent.

Sure,

Where can I find the email logs?

Are you referring to the “Activity” section within “View Client”?

It depends on the email provider you’re using, most provide a way to check which emails have been processed.

Hello, We have same issue, have anyone got the solution.