diff --git a/migrations/61-62/new-deprecations.md b/migrations/61-62/new-deprecations.md index b44322025..014e4c343 100644 --- a/migrations/61-62/new-deprecations.md +++ b/migrations/61-62/new-deprecations.md @@ -11,6 +11,20 @@ New Deprecations This page lists all the new deprecations you should be aware of and what you should now be using instead. -:::tip[Reader Note] - No deprecations have been introduced in Joomla 6.2 yet -::: +### MailTemplate accepts MailerInterface objects + +PR: [47677](https://github.com/joomla/joomla-cms/pull/47677) +Files: +- `libraries/src/Mail/MailTemplate.php` +Description: +The injected `mailer` property can be a `MailerInterface` to not enforce a `Mail` instance. Not injecting a mailer instance is deprecated and will be not supported anymore in 8.0. + +```php +// Old code +$mail = Factory::getMailer(); +$mailer = new MailTemplate('com_foo.bar', $language, $mail); + +// New: +$mail = $this->getMailerFactory()->createMailer($config); +$mailer = new MailTemplate('com_foo.bar', $language, $mail); +```