CakePHP using Email component from Shell cronjob

前端 未结 4 1387
萌比男神i
萌比男神i 2021-01-02 01:19

I\'m trying to send an email from a CakePHP shell just as you would from the Controller.

Most of the code below was adapted from this dated article on the Bakery an

4条回答
  •  既然无缘
    2021-01-02 01:50

    If you're using CakePHP 2.x, try to use CakeEmail instead.

    CakeEmail#viewVars() provides setting variables to template.

    Here is example using CakeEmail from Shell. https://gist.github.com/tsmsogn/cee9cef2e851e7684021

提交回复
热议问题