Skip to content

Instantly share code, notes, and snippets.

@jamesfg
Last active June 3, 2019 08:42
Show Gist options
  • Save jamesfg/2710cabbea59a4cf32f5 to your computer and use it in GitHub Desktop.
Save jamesfg/2710cabbea59a4cf32f5 to your computer and use it in GitHub Desktop.
Email
<?php
$Email = new CakeEmail();
$Email->template('default', 'default')
->emailFormat('html')
->to('email')
->from('email')
->viewVars(array(
'value' => 'jamesfg',
'content' => 'content test',
'title_for_layout'=> 'Title Test'))
->subject('Content Test 11')
->send();
?>
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Layouts.Email.html
* @since CakePHP(tm) v 0.10.0.1076
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title><?php echo $title_for_layout; ?></title>
</head>
<body>
<p>Here is your value: <b><?php echo $value; ?></b></p>
<br>
<?php echo $this->fetch('content'); ?>
</body>
</html>
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Emails.html
* @since CakePHP(tm) v 0.10.0.1076
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
?>
<?php
print_r($content);
echo "test"
// $content = explode("\n", $content);
//
// foreach ($content as $line):
// echo '<p> ' . $line . "</p>\n";
// echo "test";
// endforeach;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment