Jump to content
  • 0

Inovoices are not being sent - Unsent


hbandur

Question

Something strange happened on March 18th, where invoices stopped being sent after being generated. It was working fine, then it stopped. The cron is running, but all newly created invoices are stored as Unsent. Sening them manually works fine. Further to this, all other notifications such as Unpaid reminders, credit expiration works fine... and so on. Looking at Blesta's email log, it shows all other emails sent except for Invoice Creation. Manually I am able to send it, and it logs it. 

Can anyone give me an idea where to look? 

Under the delivery type is set to email and enabled. 

Looking at this component, but nothing seems to be missing or edited. 

/components/invoice_delivery/invoice_delivery.php

Any help where I should start digging?

 

I am running version 5.2

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
On 4/14/2022 at 7:52 AM, barryf said:

I am having the same issue. Nothing in the logs, in the Client area it shows the invoice as Sent, but they are not. Manually sending it works as expected.

What version of Blesta are you running? What version of PHP? Which logs are you checking? The file logs, at ../logs_blesta/ (Full path defined under Settings > System > General) may have more information. Only logs written in the files containing the word "cron" are relevant, from the time of the delivery attempt.

You can do a couple tests:

  1. Edit an invoice, make sure "Email" is checked. If it is checked, delivery should be attempted at next cron run.
  2. Wait for the cron to run, edit the invoice again and see if it is no longer checked. Is it checked? Was the email sent? Does anything appear in the Email log under Tools > Logs: Email? Is anything written to the ../logs_blesta/ file logs?

To see if the problem is related to your CLI PHP, try the following:

  1. Disable your cron job on your server.
  2. Edit an invoice, make sure "Email" is checked.
  3. Wait 5 minutes from the time you disabled your cron job. Go to Settings > System > Automation, and click the button to manually run the cron job. Was the email sent? Is "Email" unchecked for the invoice?
  4. Re-enable your cron job.

If it sends when running the cron manually in the interface, then your CLI version of PHP may be missing dependencies.

Link to comment
Share on other sites

  • 0

Hi Paul,

Thanks for the response. I am running Blesta 5.3.2 on Debian 11, PHP 7.4.

If I run cron manually all is fine. The invoice delivery is in the Email log, and email is received.

If I run cron manually from the command line, it reports "Successfully delivered 1 invoice to client #1500 via Email." and the entry is present in the Logs -> Invoice Delivery but not in the Email log and no email is sent.

In all cases, the invoices are marked as Sent, and the Invoice Delivery "Email" is unchecked.

I have double-checked that both the CLI and the Apache module are configured the same - identical php.ini and the same modules loaded.

There are no errors in the logs, nor when manually running the cron task.

Link to comment
Share on other sites

  • 0
On 8/10/2022 at 6:00 AM, barryf said:

Any ideas on this? Getting to be a pain!

 

Thanks

 

Hi Barry, when emails are generated are they queued for delivery? If you edit the invoice, is the Email box checked? If you aren't able to check quickly after they are created, you can create a manual invoice.

  1. Do the invoice emails appear in the mail log under Tools > Logs > Email?
  2. Are you using Sendmail or SMTP for outgoing email? Settings > Emails > Setup

If an invoice is queued for delivery, then marked as sent, then most likely an attempt to send it was made and did not return an error. If you are using as SMTP server and the messages are being filtered out or rejected on that side quietly, then that could explain it.

 

Link to comment
Share on other sites

  • 0
On 8/15/2022 at 8:34 PM, Paul said:

Hi Barry, when emails are generated are they queued for delivery? If you edit the invoice, is the Email box checked? If you aren't able to check quickly after they are created, you can create a manual invoice.

  1. Do the invoice emails appear in the mail log under Tools > Logs > Email?
  2. Are you using Sendmail or SMTP for outgoing email? Settings > Emails > Setup

If an invoice is queued for delivery, then marked as sent, then most likely an attempt to send it was made and did not return an error. If you are using as SMTP server and the messages are being filtered out or rejected on that side quietly, then that could explain it.

 

 

Hi Paul,

1. No, the emails do not appear in the Email log. However the invoice is marked as "Sent" and appears in the Invoice Delivery log as sent.

2. I use SMTP, however, I switched to sendmail and ran the test again and same result - not sent, not in email log and my sendmai logs show no attempt to send any email.

In all cases, if I select the invoice within the Client screen and click to send, the email gets sent successfully.

Thanks

 

image.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...