Yii Mailer 6 + Yii Mailer Symfony 4
2024-10-18
1530次浏览
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
NullMailerandStubMailer. - Add
FileMailerconfiguration. - Add
HtmlToTextBodyConverter. - Add
MessageInterfacemethods:getAttachments(),getEmbeddings(),getHeaders(),withAddedAttachments(),withAddedEmbeddings(). - Add
Messageclass that implementsMessageInterface. - Remove
MessageFactoryInterfaceandMessageFactory, addMessageSettingsinstead it. - Remove
MessageBodyRendererandMessageBodyTemplateclasses. - Remove
yiisoft/viewdependency. - Remove
MessageInterfacemethodscompose(),withTemplate()andwithLocale(). - Rename
MailertoBaseMailer, removebeforeSend()andafterSend()methods, finalize methods, and mark dependencies as read only. - Remove
getMessage()method fromAfterSendandBeforeSendclasses, make$messageproperty public read only instead it. - Change result type of
MessageInterface::with*methods fromselftostatic. - Remove implementation of
StoppableEventInterfacefromBeforeSendand add$preventSendingMessageproperty to it. - Remove
beforeSend()andafterSend()messages fromBaseMailer. - Rename
MessageInterfacemethods:withEmbedded()towithEmbeddings(),withAttached()towithAttachments()and allow passing several files to them. - Remove
getError()andwithError()methods from MessageInterface. - Change result of
MailerInterface::sendMultiple()toSendResultsobject. - Use new
Priorityenumeration instead of integer value for define priority in message. - Change order of constructor parameters in
MailerandFailMailer. - Make
psr/event-dispatcherdependency optional. - Replace
RuntimeExceptiontoLogicExceptionwhen file name callback ofFileMailerreturns 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
Messageclass, add$messageSettingsparameter toMailerconstructor, removeMessageBodyRendererusage. - Raise minimal PHP version to
^8.1. - Change order of constructor parameters in
Mailer. - Remove
FileMailerconfiguration andwriteToFilesparameter from package configuration. - Make
psr/event-dispatcherdependency optional. - Use file ID for attachments and embedded files.
新闻归档
热门标签
- yii3
- 扩展
- 发布
- yii2
- debug
- view
- auth client
- html
- bootstrap
- release
- mongodb
- redis
- apidoc
- Yii 1.1
- validation
- Yii 2.0
- http
- runner
- extensions
- console
- error handler
- gii
- mailer
- cache
- http 客户端
- queue
- twig
- hydrator
- translator
- widget
- sphinx
- router
- log
- symfonymailer
- assets
- config
- db
- swagger
- middleware
- imagine
- elasticsearch
- 图书
- swiftmailer
- widgets
- definitions
- i18n
- IDE
- fastroute
- csrf
- user