Browse Source

Fixes #4071: `mail` component renamed to `mailer`, `yii\log\EmailTarget::$mail` renamed to `yii\log\EmailTarget::$mailer`

tags/2.0.0-rc
Alexander Makarov 11 years ago
parent
commit
afd6982af3
  1. 4
      Mailer.php
  2. 4
      README.md

4
Mailer.php

@ -19,7 +19,7 @@ use yii\mail\BaseMailer;
* ~~~ * ~~~
* 'components' => [ * 'components' => [
* ... * ...
* 'mail' => [ * 'mailer' => [
* 'class' => 'yii\swiftmailer\Mailer', * 'class' => 'yii\swiftmailer\Mailer',
* 'transport' => [ * 'transport' => [
* 'class' => 'Swift_SmtpTransport', * 'class' => 'Swift_SmtpTransport',
@ -57,7 +57,7 @@ use yii\mail\BaseMailer;
* To send an email, you may use the following code: * 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') * ->setFrom('from@domain.com')
* ->setTo($form->email) * ->setTo($form->email)
* ->setSubject($form->subject) * ->setSubject($form->subject)

4
README.md

@ -9,7 +9,7 @@ To use this extension, simply add the following code in your application config
return [ return [
//.... //....
'components' => [ 'components' => [
'mail' => [ 'mailer' => [
'class' => 'yii\swiftmailer\Mailer', 'class' => 'yii\swiftmailer\Mailer',
], ],
], ],
@ -19,7 +19,7 @@ return [
You can then send an email as follows: You can then send an email as follows:
```php ```php
Yii::$app->mail->compose('contact/html') Yii::$app->mailer->compose('contact/html')
->setFrom('from@domain.com') ->setFrom('from@domain.com')
->setTo($form->email) ->setTo($form->email)
->setSubject($form->subject) ->setSubject($form->subject)

Loading…
Cancel
Save