Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions migrations/61-62/new-deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```