diff --git a/src/Plugin/Mail/SwiftMailer.php b/src/Plugin/Mail/SwiftMailer.php
index f5559a6..1b5222b 100644
--- a/src/Plugin/Mail/SwiftMailer.php
+++ b/src/Plugin/Mail/SwiftMailer.php
@@ -353,8 +353,8 @@ class SwiftMailer implements MailInterface, ContainerFactoryPluginInterface {
         }
       }
 
-      // Invoke 'hook_swiftmailer_alter' for other module to customize the message
-      \Drupal::moduleHandler()->invokeAll('swiftmailer_alter', [&$mailer, &$m, $message]);
+      // Allows other modules to customize the message.
+      $this->moduleHandler->invokeAll('swiftmailer_alter', [$mailer, $m, $message]);
 
       // Send the message.
       Conversion::swiftmailer_filter_message($m);
