Skip to content

Commit

Permalink
Change name of Email::deliver() config argument
Browse files Browse the repository at this point in the history
`$transportConfig` is misleading
  • Loading branch information
garas committed Jun 5, 2018
1 parent 5bceac6 commit 75397c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Mailer/Email.php
Expand Up @@ -347,7 +347,7 @@ class Email implements JsonSerializable, Serializable
/** /**
* Constructor * Constructor
* *
* @param array|string|null $config Array of configs, or string to load configs from email.php * @param array|string|null $config Array of configs, or string to load configs from app.php
*/ */
public function __construct($config = null) public function __construct($config = null)
{ {
Expand Down Expand Up @@ -2218,20 +2218,20 @@ protected function flatten($value)
* @param string|array|null $to Address to send (see Cake\Mailer\Email::to()). If null, will try to use 'to' from transport config * @param string|array|null $to Address to send (see Cake\Mailer\Email::to()). If null, will try to use 'to' from transport config
* @param string|null $subject String of subject or null to use 'subject' from transport config * @param string|null $subject String of subject or null to use 'subject' from transport config
* @param string|array|null $message String with message or array with variables to be used in render * @param string|array|null $message String with message or array with variables to be used in render
* @param string|array $transportConfig String to use config from EmailConfig or array with configs * @param string|array $config String to use Email delivery profile from app.php or array with configs
* @param bool $send Send the email or just return the instance pre-configured * @param bool $send Send the email or just return the instance pre-configured
* @return static Instance of Cake\Mailer\Email * @return static Instance of Cake\Mailer\Email
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public static function deliver($to = null, $subject = null, $message = null, $transportConfig = 'default', $send = true) public static function deliver($to = null, $subject = null, $message = null, $config = 'default', $send = true)
{ {
$class = __CLASS__; $class = __CLASS__;


if (is_array($transportConfig) && !isset($transportConfig['transport'])) { if (is_array($config) && !isset($config['transport'])) {
$transportConfig['transport'] = 'default'; $config['transport'] = 'default';
} }
/* @var \Cake\Mailer\Email $instance */ /* @var \Cake\Mailer\Email $instance */
$instance = new $class($transportConfig); $instance = new $class($config);
if ($to !== null) { if ($to !== null) {
$instance->setTo($to); $instance->setTo($to);
} }
Expand Down

0 comments on commit 75397c5

Please sign in to comment.