Yii Mailer 6 + Yii Mailer Symfony 4
2024-10-18
351次浏览
Major versions of Yii Mailer and Yii Mailer Symfony Mailer packages were tagged.
The Yii Mailer abstraction for sending emails has been significantly reworked.
Now, the package yiisoft/mailer
is independent of any other dependencies and essentially consists of two interfaces:
MessageInterface
(a message with methods for setting/getting values) and MailerInterface
(a service for sending messages with two methods: send()
and sendMultiple()
).
Yii Mailer changes:
- Add
NullMailer
andStubMailer
. - Add
FileMailer
configuration. - Add
HtmlToTextBodyConverter
. - Add
MessageInterface
methods:getAttachments()
,getEmbeddings()
,getHeaders()
,withAddedAttachments()
,withAddedEmbeddings()
. - Add
Message
class that implementsMessageInterface
. - Remove
MessageFactoryInterface
andMessageFactory
, addMessageSettings
instead it. - Remove
MessageBodyRenderer
andMessageBodyTemplate
classes. - Remove
yiisoft/view
dependency. - Remove
MessageInterface
methodscompose()
,withTemplate()
andwithLocale()
. - Rename
Mailer
toBaseMailer
, removebeforeSend()
andafterSend()
methods, finalize methods, and mark dependencies as read only. - Remove
getMessage()
method fromAfterSend
andBeforeSend
classes, make$message
property public read only instead it. - Change result type of
MessageInterface::with*
methods fromself
tostatic
. - Remove implementation of
StoppableEventInterface
fromBeforeSend
and add$preventSendingMessage
property to it. - Remove
beforeSend()
andafterSend()
messages fromBaseMailer
. - Rename
MessageInterface
methods:withEmbedded()
towithEmbeddings()
,withAttached()
towithAttachments()
and allow passing several files to them. - Remove
getError()
andwithError()
methods from MessageInterface. - Change result of
MailerInterface::sendMultiple()
toSendResults
object. - Use new
Priority
enumeration instead of integer value for define priority in message. - Change order of constructor parameters in
Mailer
andFailMailer
. - Make
psr/event-dispatcher
dependency optional. - Replace
RuntimeException
toLogicException
when file name callback ofFileMailer
returns non-string value and improve - exception message.
Yii Mailer Symfony Mailer Extension changes:
- Change package configuration params prefix to
yiisoft/mailer-symfony
. - Adapt to Yii Mailer 6: remove
Message
class, add$messageSettings
parameter toMailer
constructor, removeMessageBodyRenderer
usage. - Raise minimal PHP version to
^8.1
. - Change order of constructor parameters in
Mailer
. - Remove
FileMailer
configuration andwriteToFiles
parameter from package configuration. - Make
psr/event-dispatcher
dependency optional. - Use file ID for attachments and embedded files.
新闻归档
热门标签
- yii3
- 扩展
- 发布
- yii2
- debug
- auth client
- view
- bootstrap
- html
- release
- redis
- apidoc
- Yii 2.0
- Yii 1.1
- mongodb
- mailer
- extensions
- twig
- gii
- queue
- runner
- http 客户端
- console
- validation
- sphinx
- cache
- widget
- translator
- hydrator
- error handler
- db
- symfonymailer
- log
- http
- config
- assets
- swiftmailer
- 图书
- imagine
- csrf
- elasticsearch
- swagger
- IDE
- i18n
- router
- definitions
- fastroute
- logging
- smarty
- user