diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php index 1920c6466..be02a4fc7 100644 --- a/lib/Cake/Controller/Component/EmailComponent.php +++ b/lib/Cake/Controller/Component/EmailComponent.php @@ -332,6 +332,7 @@ class EmailComponent extends Component { } $lib->subject($this->subject)->messageID($this->messageId); + $lib->helpers($this->_controller->helpers); $headers = array('X-Mailer' => $this->xMailer); foreach ($this->headers as $key => $value) { diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index c929168f2..0e8b3317d 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -181,6 +181,13 @@ class CakeEmail { */ protected $_viewVars = array(); +/** + * Helpers to be used in the render + * + * @var array + */ + protected $_helpers = array(); + /** * Text message * @@ -715,6 +722,20 @@ class CakeEmail { return $this; } +/** + * Helpers to be used in render + * + * @param array $helpers + * @return mixed + */ + public function helpers($helpers = null) { + if ($helpers === null) { + return $this->_helpers; + } + $this->_helpers = (array)$helpers; + return $this; + } + /** * Email format * @@ -1057,6 +1078,7 @@ class CakeEmail { $this->_template = ''; $this->_viewRender = 'View'; $this->_viewVars = array(); + $this->_helpers = array(); $this->_textMessage = ''; $this->_htmlMessage = ''; $this->_message = ''; @@ -1260,6 +1282,7 @@ class CakeEmail { $View = new $viewClass(null); $View->viewVars = $this->_viewVars; + $View->helpers = $this->_helpers; $msg = array(); list($templatePlugin, $template) = pluginSplit($this->_template, true); diff --git a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php index 163ec2dd4..d2a6196b2 100644 --- a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php @@ -501,6 +501,7 @@ TEXTBLOC;
Here is your value: 22091985
+This email was sent using the CakePHP Framework