Search code examples
phpsymfony1doctrinepropel

Accessing the database and sending an email in a symfony batch script


I am running Symfony 1.3.2 on Ubuntu. I need to write a batch script that can:

  • Access the database using the ORM
  • Send email(s)

IIRC, this was in a previous cookback, but I thing that was for an earlier version of Symfony (the API may have changed since).

Does anyone know how I may access the database via the ORM layer in a batch script and also how to send out email(s) in a batch script?


Solution

  • See also Sending email from a task in the "More with symfony" book.

    If you get your task working, you can run it from cron or the command line.