diff --git a/src/Plugin/Mail/SwiftMailer.php b/src/Plugin/Mail/SwiftMailer.php index 3e89311..1d5d0a3 100644 --- a/src/Plugin/Mail/SwiftMailer.php +++ b/src/Plugin/Mail/SwiftMailer.php @@ -627,7 +627,7 @@ class SwiftMailer implements MailInterface, ContainerFactoryPluginInterface { // and then treat the result as safe markup. $line_endings = Settings::get('mail_line_endings', PHP_EOL); $applicable_format = $this->getApplicableFormat($message); - $filter_format = $this->config['message']['filter_format']; + $filter_format = isset($this->config['message']['filter_format']) ? $this->config['message']['filter_format'] : filter_fallback_format(); $message['body'] = Markup::create(implode($line_endings, array_map(function ($body) use ($applicable_format, $filter_format) { // If the body contains no html tags but the applicable format is HTML, // we can assume newlines will need be converted to
. diff --git a/swiftmailer.install b/swiftmailer.install index 2e48116..fb889b9 100644 --- a/swiftmailer.install +++ b/swiftmailer.install @@ -27,6 +27,7 @@ function swiftmailer_requirements($phase) { */ function swiftmailer_install() { $settings = Drupal::configFactory()->getEditable('mailsystem.settings'); + $settings->set('filter_format', 'plain_text'); $settings->set('modules.swiftmailer.none', [ 'formatter' => 'swiftmailer', 'sender' => 'swiftmailer',