Skip to content

Commit

Permalink
Can't override CakeEmail class and use deliver
Browse files Browse the repository at this point in the history
When using TemplateEmail::deliver it always create new instance of CakeEmail, I assume it should create my extended "TemplateEmail" class insted.

PHP >5.3 compatible
  • Loading branch information
kolorafa committed Jun 13, 2016
1 parent d352b5f commit 449e5fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Network/Email/CakeEmail.php
Expand Up @@ -1203,7 +1203,7 @@ public function send($content = null) {
* @throws SocketException
*/
public static function deliver($to = null, $subject = null, $message = null, $transportConfig = 'fast', $send = true) {
$class = __CLASS__;
$class = get_called_class();
/** @var CakeEmail $instance */
$instance = new $class($transportConfig);
if ($to !== null) {
Expand Down

0 comments on commit 449e5fc

Please sign in to comment.