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' => [
* ...
* '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)

4
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)

Loading…
Cancel
Save