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