diff --git a/README.txt b/README.txt
index f2cc77d..2751d87 100644
--- a/README.txt
+++ b/README.txt
@@ -337,3 +337,9 @@ simply provide the HTML version in $message['body'] and the plain text version
 in $message['plain']. Please make sure you set $message['params']['format'] to
 'text/html'. The Swift Mailer module will not attempt to generate a plain text
 version if one is already available.
+
+5.0 Custom settings/behavior
+
+If you want to add custom settings or behavior to the mailer or the message,
+before the it is sent, you can implement hook_swiftmailer_alter().
+See swiftmailer.api.php for an example.
diff --git a/src/Plugin/Mail/SwiftMailer.php b/src/Plugin/Mail/SwiftMailer.php
index 4c3933a..e6a219c 100644
--- a/src/Plugin/Mail/SwiftMailer.php
+++ b/src/Plugin/Mail/SwiftMailer.php
@@ -25,6 +25,7 @@ use Swift_Image;
 use Swift_Mailer;
 use Swift_MailTransport;
 use Swift_Message;
+use Swift_NullTransport;
 use Swift_SendmailTransport;
 use Swift_SmtpTransport;
 use Swift_SpoolTransport;
@@ -61,6 +62,11 @@ class SwiftMailer implements MailInterface, ContainerFactoryPluginInterface {
    */
   protected $moduleHandler;
 
+  /**
+   * @var Swift_Mailer
+   */
+  protected $mailer;
+
   /**
    * SwiftMailer constructor.
    *
@@ -384,9 +390,17 @@ class SwiftMailer implements MailInterface, ContainerFactoryPluginInterface {
             $transport = Swift_SpoolTransport::newInstance($spool);
             $mailer = Swift_Mailer::newInstance($transport);
             break;
+
+          case SWIFTMAILER_TRANSPORT_NULL:
+            $transport = Swift_NullTransport::newInstance();
+            $mailer = Swift_Mailer::newInstance($transport);
+            break;
         }
       }
 
+      // Allows other modules to customize the message.
+      $this->moduleHandler->alter('swiftmailer', $mailer, $m, $message);
+
       // Send the message.
       Conversion::swiftmailer_filter_message($m);
       return (bool) $mailer->send($m);
diff --git a/swiftmailer.api.php b/swiftmailer.api.php
new file mode 100644
index 0000000..ade6a43
--- /dev/null
+++ b/swiftmailer.api.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * Hooks specific to the SwiftMailer module.
+ */
+
+/**
+ * @addtogroup hooks
+ * @{
+ */
+
+/**
+ * Alter messages before sending it with SwiftMailer.
+ *
+ * @see \Drupal\swiftmailer\Plugin\Mail\SwiftMailer::mail
+ */
+function hook_swiftmailer_alter(Swift_Mailer &$swiftMailer, Swift_Message &$swiftMessage, $message) {
+  // Set read receipt.
+  $swiftMessage->setReadReceiptTo('your@address.com');
+
+  // Register a SwiftMailer Plugin.
+  // @see https://swiftmailer.symfony.com/docs/plugins.html
+  $replacements = [];
+  $decorator = new Swift_Plugins_DecoratorPlugin($replacements);
+  $swiftMailer->registerPlugin($decorator);
+}
+
+/**
+ * @} End of "addtogroup hooks".
+ */
diff --git a/swiftmailer.module b/swiftmailer.module
index 5805349..a0aa238 100644
--- a/swiftmailer.module
+++ b/swiftmailer.module
@@ -23,6 +23,7 @@ define('SWIFTMAILER_TRANSPORT_SMTP', 'smtp');
 define('SWIFTMAILER_TRANSPORT_SENDMAIL', 'sendmail');
 define('SWIFTMAILER_TRANSPORT_NATIVE', 'native');
 define('SWIFTMAILER_TRANSPORT_SPOOL', 'spool');
+define('SWIFTMAILER_TRANSPORT_NULL', 'null');
 
 // Define header types.
 define('SWIFTMAILER_HEADER_TEXT', 'text');
diff --git a/tests/modules/swiftmailer_test/src/SwiftMailerDrupalStateLogger.php b/tests/modules/swiftmailer_test/src/SwiftMailerDrupalStateLogger.php
new file mode 100644
index 0000000..2792648
--- /dev/null
+++ b/tests/modules/swiftmailer_test/src/SwiftMailerDrupalStateLogger.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\swiftmailer_test;
+
+use Swift_Events_SendEvent;
+use Swift_Events_SendListener;
+
+class SwiftMailerDrupalStateLogger implements Swift_Events_SendListener {
+
+  public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
+    $this->add([
+      'method' => 'beforeSendPerformed',
+      'body' => $evt->getMessage()->getBody(),
+      'subject' => $evt->getMessage()->getSubject()
+    ]);
+  }
+
+  public function sendPerformed(Swift_Events_SendEvent $evt) {
+    $this->add([
+      'method' => 'sendPerformed',
+      'body' => $evt->getMessage()->getBody(),
+      'subject' => $evt->getMessage()->getSubject()
+    ]);
+  }
+
+  public function add($entry) {
+    $captured_emails = \Drupal::state()->get('swiftmailer.mail_collector') ?: [];
+    $captured_emails[] = $entry;
+    \Drupal::state()->set('swiftmailer.mail_collector', $captured_emails);
+  }
+
+  public function clear() {
+    \Drupal::state()->delete('swiftmailer.mail_collector');
+  }
+
+  public function dump() {
+    return \Drupal::state()->get('swiftmailer.mail_collector', []);
+  }
+
+}
diff --git a/tests/modules/swiftmailer_test/swiftmailer_test.info.yml b/tests/modules/swiftmailer_test/swiftmailer_test.info.yml
new file mode 100644
index 0000000..20fc654
--- /dev/null
+++ b/tests/modules/swiftmailer_test/swiftmailer_test.info.yml
@@ -0,0 +1,6 @@
+name: 'SwiftMailer Test Module'
+type: module
+description: 'Support module for SwiftMailer testing.'
+package: Testing
+version: VERSION
+core: 8.x
diff --git a/tests/modules/swiftmailer_test/swiftmailer_test.module b/tests/modules/swiftmailer_test/swiftmailer_test.module
new file mode 100644
index 0000000..a91a951
--- /dev/null
+++ b/tests/modules/swiftmailer_test/swiftmailer_test.module
@@ -0,0 +1,15 @@
+<?php
+
+use Drupal\swiftmailer_test\SwiftMailerDrupalStateLogger;
+
+/**
+ * Alter messages before sending it with SwiftMailer.
+ *
+ * @see \Drupal\swiftmailer\Plugin\Mail\SwiftMailer::mail
+ */
+function swiftmailer_test_swiftmailer_alter(Swift_Mailer &$swiftMailer, Swift_Message &$swiftMessage, &$message) {
+  if ($message['key'] == 'test_1') {
+    $swiftMessage->setBody('Replace text in swiftmailer_test_swiftmailer_alter');
+    $swiftMailer->registerPlugin(new SwiftMailerDrupalStateLogger());
+  }
+}
diff --git a/tests/src/Functional/SwiftMailerAlterTest.php b/tests/src/Functional/SwiftMailerAlterTest.php
new file mode 100644
index 0000000..3ab99dd
--- /dev/null
+++ b/tests/src/Functional/SwiftMailerAlterTest.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Drupal\Tests\swiftmailer\Functional;
+
+use Drupal;
+use Drupal\Core\Test\AssertMailTrait;
+use Drupal\swiftmailer_test\SwiftMailerDrupalStateLogger;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * @group swiftmailer
+ */
+class SwiftMailerAlterTest extends BrowserTestBase {
+
+  public static $modules = ['swiftmailer_test', 'swiftmailer', 'mailsystem'];
+
+  public function testAlter() {
+    Drupal::configFactory()
+      ->getEditable('mailsystem.settings')
+      ->set('modules.swiftmailer_test.none', [
+        'formatter' => 'swiftmailer',
+        'sender' => 'swiftmailer',
+      ])
+      ->save();
+    Drupal::configFactory()
+      ->getEditable('swiftmailer.transport')
+      ->set('transport', 'null')
+      ->save();
+    \Drupal::state()->set('swiftmailer_test_swiftmailer_alter_1', TRUE);
+    \Drupal::service('plugin.manager.mail')->mail('swiftmailer_test', 'test_1', 'test@example.com', \Drupal::languageManager()->getDefaultLanguage()->getId());
+    $logger = new SwiftMailerDrupalStateLogger();
+    $this->assertEquals('Replace text in swiftmailer_test_swiftmailer_alter', $logger->dump()[0]['body']);
+  }
+
+}
