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 fromMessageInterface
. - 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.