Why not put all of your logic within the model/controller and then call that 
from the shell script/cron job you have going?  That way you could access those 
methods from the app and not just the shell script.  Doesn't make sense to 
separate that kind of logic..

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of 
DigitalDude
Sent: Tuesday, August 03, 2010 2:13 PM
To: CakePHP
Subject: Sending StatusMails by CronJob - what is the right approach?

Hey,

I read uncountable articles now and tried really hard to get this to
work, but I just can't figure out how to solve this problem:

Let's say I want to write a cronjob that will check every sunday
what's new in a database and sends an overview of things that are
still to do to the users of my app.

I found several approaches to do that, but I can't figure out what's
the best way here.

I know how to call a shell script from a cron job and I already
managed to do this, I even have Access to a model and even controller
actions.

The other thing I have is a way to run actions directly from shell by
a dispatcher-script which I found in the bakery.

Both approaches have one big problem:
I CAN'T get them to send an email thorugh the Cake Email-Component!

No matter what I do, if the sending is within the called action by the
dispatcher call or if I try do import the Email-Component into the
Shell-script, it will never send me any email.

Additionally, I need to know one very important thing:

Does the logic for such status reports (or even newsletters or so)
belong into the SHELL script or is it common to call a specific action
in a specific controller to collect the data that is needed and send
the email?

It would be MUCH appreciated if somebody could even give me a hint or
maybe just an opinion to these questions...

Regards,

DD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Homepage: http://www.blueclover.com  |  Blog: http://www.blue-ings.com  |  
Twitter: http://twitter.com/bluecloverusa  |  Facebook: 
http://www.facebook.com/blueclover  | YouTube: 
http://www.youtube.com/user/bluecloverstudios | Join Our Mailing List: 
http://visitor.constantcontact.com/manage/optin?v=001ti8yLLtrqgo7unTQ7RVsh7BIcda1iEtM

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

This email transmission, including any attachments thereto, may contain 
information that is proprietary and confidential. The information is intended 
only for the use of the individual(s) or entity to whom this email has been 
addressed. If you are not the intended recipient, or the person responsible for 
delivering it to the intended recipient, you are hereby notified that any 
disclosure, copying, distribution or use of any of the information is strictly 
prohibited. If you have received this transmission in error, please let us know 
immediately and delete the email, including any attachments thereto, from your 
computer.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to