Browse Source

Methods `addHeader()`, `setHeader()`, `getHeader()`, `setHeaders()` have been added to `yii\i18n\MessageInterface` allowing setup of custom message headers

tags/3.0.0-alpha1
Klimov Paul 8 years ago
parent
commit
e3f26cc5dc
  1. 1
      framework/CHANGELOG.md
  2. 8
      framework/UPGRADE.md
  3. 35
      framework/mail/MessageInterface.php

1
framework/CHANGELOG.md

@ -5,6 +5,7 @@ Yii Framework 2 Change Log
-----------------------
- Enh #11058: Add `$checkAjax` parameter to method `yii\web\Controller::redirect()` which controls redirection in AJAX and PJAX requests (ivanovyordan)
- Enh #12385: Methods `addHeader()`, `setHeader()`, `getHeader()`, `setHeaders()` have been added to `yii\i18n\MessageInterface` allowing setup of custom message headers (klimov-paul)
- Enh #12592: Optimized `yii\filters\AccessController` on processing accessrules (dynasource)
- Enh #12938: Allow to pass additional parameters to `yii\base\View::renderDynamic()` (mikehaertl)
- Enh #13006: Added a `/` to the `yii\captcha\Captcha::$captchaAction` string to work correctly in a module also (boehsermoe)

8
framework/UPGRADE.md

@ -50,6 +50,14 @@ if you want to upgrade from version A to version C and there is
version B between A and C, you need to follow the instructions
for both A and B.
Upgrade from Yii 2.0.x
----------------------
* Following new methods have been added to `yii\i18n\MessageInterface` `addHeader()`, `setHeader()`, `getHeader()`, `setHeaders()`
providing ability to setup custom mail headers. Make sure your provide implementation for those methods, while
creating your own mailer solution.
Upgrade from Yii 2.0.11
-----------------------

35
framework/mail/MessageInterface.php

@ -203,6 +203,41 @@ interface MessageInterface
public function embedContent($content, array $options = []);
/**
* Adds custom header value to the message.
* Several invocations of this method with the same name will add multiple header values.
* @param string $name header name.
* @param string $value header value.
* @return $this self reference.
* @since 2.1
*/
public function addHeader($name, $value);
/**
* Sets custom header value to the message.
* @param string $name header name.
* @param string|array $value header value or values.
* @return $this self reference.
* @since 2.1
*/
public function setHeader($name, $value);
/**
* Returns all values for the specified header.
* @param string $name header name.
* @return array header values list.
* @since 2.1
*/
public function getHeader($name);
/**
* Sets custom header values to the message.
* @param array $headers headers in format: `[name => value]`.
* @return $this self reference.
* @since 2.1
*/
public function setHeaders($headers);
/**
* Sends this email message.
* @param MailerInterface $mailer the mailer that should be used to send this message.
* If null, the "mail" application component will be used instead.

Loading…
Cancel
Save