Jump to content
  • 0

Email Not Being Sent On Invoice Creation


lori

Question

Hi,

 

When I create an invoice and check the 'send email' box, no email is sent and the invoice is labeled as unsent in client profile. 

 

If I check the box for the invoice on the client profile page, and then click 'submit' to email the invoice, the email is sent as it should be.

 

How can I get the email to be sent when the invoice is first created?

 

Thanks.

Link to comment
Share on other sites

Recommended Posts

  • 0

Thxs to Tyson about explanation on Cron task Lock in Blesta.

 

Just to share, as my concern was to have a safe 2 mins cron frequency, (my above previous script & lock was not good)

I finally found more deadly easy solution using solo, and that work fine on blesta cron:

 

http://timkay.com/solo/

 

Naturally this beats working with lock/PID files, because an open port is directly tied to a running process, and chances of inconsistency and having to detect and cleanup orphaned PID files, are zero.

 

and regarding 2mins cron frequency VS 5mins recommended by default, I'm not a believers it will consume a lot of resources, if we should avoid using php resources, we should be also afraid when customers load website pages as powered all by php.

 

Solo, need you have Perl installed on your server

 

to create the solo file from console:

----------------------------------------------------------

curl -q http://timkay.com/solo/solo -o /usr/local/bin/solo \

  && chmod a+x $_

 

 

open crontab as root in console:

-------------------------------------

crontab -u root -e

 

 

Next ad this line in crontab:

--------------------------------

*/2 * * * * /usr/local/bin/solo -port=5001 php /PATH-TO-BLESTA/index.php cron

 

 

N.B.:

----

As root you can use any available port above 1023. The maximum allowed port number is 65535,  but use only one port by cron.

In above case, cron frequency is 2 mins.

 

Next,

--------

Check in Database Table cron_task_runs table, take note of what are the task_id you want to speed the cron interval.

In my case it was task_id : 4, 5, 18 as I want new ordered service when paid, be fast activated

And open Table task_id in database, and edit row where task_id & company_id you want to speed interval, & update, In my case I have updated all above task_id to interval 2 . (2mins)

 

 

--------------------------

Ref.:  http://kvz.io/blog/2012/12/31/lock-your-cronjobs/

 

The Flow

  • Can it open your port ?    
  •         so it's will be starting Blesta cron script
  • Can't open your port?
    • Never mind, Blesta cron script is probably still running, will try again next time
Naturally this beats working with lock/PID files, because an open port is directly tied to a running process, and chances of inconsistency and having to detect and cleanup orphaned PID files, are zero.

------------------------

you solution is just for root users .other thathave just simple host or reseller account will not work for them .

at the end thank for your solution , i will try it .

Link to comment
Share on other sites

  • 0

I do not have shared server, so I can not say at 100%

 

are you able to edit crontab or add cron on a shared server?

 

have you console access?

 

try this to edit crontab in console:

crontab -u YOUR-USER -e

 

 

Or more simple, just use your control panel menu to add a new cron.

 

As said above I can not say at 100% for shared server, I do not have, so I can not try

 

Be aware that by design webcron will not be working with solo, it's made for internally initiated cron VS cron run from URL (webcron)

 

and basically to create solo from an other way than command line (console), just copy file content here: http://timkay.com/solo/solo

create solo file without file extension, and make this file executable, and place this file at any place you want (level above of public_html are better for security , and adapt cronjob line with your given path to solo file

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...