diff --git a/lib/Cake/Network/Email/Email.php b/lib/Cake/Network/Email/Email.php index 318a59ca5ae..185a0119c4b 100644 --- a/lib/Cake/Network/Email/Email.php +++ b/lib/Cake/Network/Email/Email.php @@ -1237,30 +1237,21 @@ public static function deliver($to = null, $subject = null, $message = null, $tr return $instance; } -/** - * Read the configuration profile for a given name. - * - * @param string $name The name to read. - * @return array - * @throws Cake\Error\Exception When using a configuration that doesn't exist. - */ - protected function _getConfig($name) { - $config = static::config($name); - if (empty($config)) { - throw new Error\Exception(__d('cake_dev', 'Unknown email configuration "%s".', $name)); - } - return $config; - } - /** * Apply the config to an instance * * @param string|array $config * @return void + * @throws Cake\Error\Exception When using a configuration that doesn't exist. */ protected function _applyConfig($config) { if (is_string($config)) { - $config = $this->_getConfig($config); + $name = $config; + $config = static::config($name); + if (empty($config)) { + throw new Error\Exception(__d('cake_dev', 'Unknown email configuration "%s".', $name)); + } + unset($name); } $this->_profile = array_merge($this->_profile, $config); if (!empty($config['charset'])) {