simberak Posted June 20, 2017 Share Posted June 20, 2017 I am running a cron job every night (importing products from feed) and I would like to get the results to my e-mail after the script ends. Can you help me to implement this? I have cron.php in which is this: <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/importfast.php'); $importFast = new ImportFast(); $importFast->cron(); ?> Can this be done? Maybee to this file or to /importfast.php? And how to make it? Thank you very much for help, Daniel Link to comment Share on other sites More sharing options...
BalzoT Posted June 21, 2017 Share Posted June 21, 2017 Yes it can be done. You must figure out how to retrieve the info that has to be sent to you with an email and set it up. if we assume that you alter the cron function a bit in order to return the data inserted your code should be changed to something like <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/importfast.php'); $importFast = new ImportFast(); $data = $importFast->cron(); mail("[email protected]","My subject",$data); ?> Link to comment Share on other sites More sharing options...
Tessie Posted June 22, 2017 Share Posted June 22, 2017 (edited) You can use www.easycron.com which allows great control, it sends out alerts email if a cron job fails or succeeds. Edited June 22, 2017 by Tessie (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now