Last active
August 29, 2015 14:22
-
-
Save tsmsogn/cee9cef2e851e7684021 to your computer and use it in GitHub Desktop.
[cakephp]Using Email from Shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $a; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('CakeEmail','Network/Email'); | |
class FooShell extends AppShell { | |
public function main() { | |
$Email = new CakeEmail(); | |
$Email->config(array( | |
'to' => array('foo@bar.baz'), | |
'from' => 'foo@bar.baz', | |
'subject' => __('subject'), | |
'template' => 'foo' | |
)); | |
// Set variables to template | |
$Email->viewVars(array('a' => 1)); | |
// Send email | |
$Email->send(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment