![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqc-3s8P-ZKErNRgyQJJeYIlVp9S5rNfl9yQ_a_s8gG9CfEVWRsMybHC2JR1j7uLCzBIuSHOBg5ciHd-Kv12T69J0-4DNtQVpNaXwr0e0-JYyQhGjnjr6vIxl_6P1GgFcGTwC9/s200/emailmeme.jpg)
First, thanks to @cordoval at the #symfony channel for suggesting me to use a symfony2 command to do this.
To use this command you must have the SwiftmailerBundle enabled. More info here.
This is a simple Symfony2 command to send an email, you should add it to a "Command" directory inside your bundle and replace the namespace to fit your project bundle:
The email body is just "test" but you can probably modified it you need to.
Test the new command by running the following:
php app/console capifony:sendemail emailfrom@server.com emailto@server.com subject
Finally, this task will run the capifony:sendemail command after the deployment is complete, be sure to add it to your Capifony script:
Want to learn more about Symfony2 console/command-line commands?
http://symfony.com/doc/current/cookbook/console.html
http://www.craftitonline.com/2011/06/calling-commands-within-commands-in-symfony2/
2 comments:
It won't really have effect, I consider like this.
Really this Blogger is doing a great job in peoples life,I recommmend this site..http//www.unn.edu.ng to this site because of their undelaying efforts too.
Post a Comment