Tuesday, August 3, 2010

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: