From afd6982af372e6f99b92345b7fc0de7cdf0c9393 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 26 Jun 2014 18:28:28 +0400 Subject: [PATCH] Fixes #4071: `mail` component renamed to `mailer`, `yii\log\EmailTarget::$mail` renamed to `yii\log\EmailTarget::$mailer` --- Mailer.php | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mailer.php b/Mailer.php index 73f8ed5..3368971 100644 --- a/Mailer.php +++ b/Mailer.php @@ -19,7 +19,7 @@ use yii\mail\BaseMailer; * ~~~ * 'components' => [ * ... - * 'mail' => [ + * 'mailer' => [ * 'class' => 'yii\swiftmailer\Mailer', * 'transport' => [ * 'class' => 'Swift_SmtpTransport', @@ -57,7 +57,7 @@ use yii\mail\BaseMailer; * To send an email, you may use the following code: * * ~~~ - * Yii::$app->mail->compose('contact/html', ['contactForm' => $form]) + * Yii::$app->mailer->compose('contact/html', ['contactForm' => $form]) * ->setFrom('from@domain.com') * ->setTo($form->email) * ->setSubject($form->subject) diff --git a/README.md b/README.md index fa987c8..cf1ca61 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ To use this extension, simply add the following code in your application config return [ //.... 'components' => [ - 'mail' => [ + 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', ], ], @@ -19,7 +19,7 @@ return [ You can then send an email as follows: ```php -Yii::$app->mail->compose('contact/html') +Yii::$app->mailer->compose('contact/html') ->setFrom('from@domain.com') ->setTo($form->email) ->setSubject($form->subject)