Skip to content
This repository was archived by the owner on Feb 6, 2022. It is now read-only.

Fixing check for swiftmailer in EmailSenderListener #313

Merged
merged 1 commit into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
**Swiftmailer will stop being maintained at the end of November 2021.**

Please, move to Symfony Mailer at your earliest convenience.
Symfony Mailer is the next evolution of Swiftmailer.
It provides the same features with support for modern PHP code and support for third-party providers.
See https://symfony.com/doc/current/mailer.html for more information.

# 3.5.0

* Fix support for "stream_options" in configuration
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/EnsureNoHotPathPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EnsureNoHotPathPass extends AbstractRecursivePass
{
protected function processValue($value, $isRoot = false)
{
if ($value instanceof Definition && 0 === strpos($value->getClass(), 'Swift_')) {
if ($value instanceof Definition && null !== ($class = $value->getClass()) && 0 === strpos($class, 'Swift_')) {
$value->clearTag('container.hot_path');
}

Expand Down
2 changes: 1 addition & 1 deletion EventListener/EmailSenderListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function onException()

public function onTerminate()
{
if (!$this->container->has('mailer') || $this->wasExceptionThrown) {
if ((!$this->container->has('mailer') && !$this->container->has('swiftmailer.mailer.default')) || $this->wasExceptionThrown) {
return;
}
$mailers = array_keys($this->container->getParameter('swiftmailer.mailers'));
Expand Down
6 changes: 6 additions & 0 deletions Resources/doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Installation
============

**Swiftmailer will stop being maintained at the end of November 2021.**

Please, move to `Symfony Mailer <https://symfony.com/doc/current/mailer.html>`_ at your earliest convenience.
`Symfony Mailer <https://symfony.com/doc/current/mailer.html>`_ is the next evolution of Swiftmailer.
It provides the same features with support for modern PHP code and support for third-party providers.

Step 1: Download the Bundle
---------------------------

Expand Down