I need to create a script to periodically send emails to some users. I thought about creating a function in the controller and the path in the routing and in the cron job call www.mydomain.com/send, for example.
But I do not think this is the best way to do this, because any user can call the script. What is the right way to do this?
class UserController extends Controller{ public function sendAction(){ $em = $this->getDoctrine()->getEntityManager(); ... } }
nasy source share