Commit f66c0957 authored by Adam Shepherd's avatar Adam Shepherd
Browse files

Issue #3281367 by AdamPS, svendecabooter, znerol: Allow EmailBuilder plugin...

Issue #3281367 by AdamPS, svendecabooter, znerol: Allow EmailBuilder plugin not linked to module name or config entity
parent 70676ecf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ use Drupal\symfony_mailer\EmailInterface;
 *     "mail" = @Translation("Message"),
 *     "copy" = @Translation("Sender copy"),
 *   },
 *   proxy = TRUE,
 * )
 *
 * @todo Notes for adopting Symfony Mailer into Drupal core. This builder can
@@ -56,7 +57,7 @@ class ContactEmailBuilder extends ContactEmailBuilderBase {
    if (isset($message['params']['contact_form'])) {
      return $factory->newEntityEmail($message['params']['contact_form'], $key, $contact_message, $sender);
    }
    return $factory->newModuleEmail('contact', $key, $contact_message, $sender, $message['params']['recipient']);
    return $factory->newTypedEmail('contact', $key, $contact_message, $sender, $message['params']['recipient']);
  }

  /**
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ use Drupal\symfony_mailer\Entity\MailerPolicy;
 *     "autoreply" = @Translation("Auto-reply"),
 *   },
 *   has_entity = TRUE,
 *   proxy = TRUE,
 *   common_adjusters = {"email_subject", "email_body", "email_to"},
 *   import = @Translation("Contact form recipients"),
 * )
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class LegacyEmailBuilder extends EmailBuilderBase implements ContainerFactoryPlu
   * {@inheritdoc}
   */
  public function fromArray(EmailFactoryInterface $factory, array $message) {
    return $factory->newModuleEmail($message['module'], $message['key'], $message);
    return $factory->newTypedEmail($message['module'], $message['key'], $message);
  }

  /**
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ use Drupal\symfony_mailer\Entity\MailerPolicy;
 *     "subscribe" = @Translation("Subscription confirmation"),
 *     "validate" = @Translation("Validate"),
 *   },
 *   proxy = TRUE,
 *   common_adjusters = {"email_subject", "email_body"},
 *   import = @Translation("Simplenews subscriber settings"),
 *   import_warning = @Translation("This overrides the default HTML messages with imported plain text versions."),
@@ -46,7 +47,7 @@ class SimplenewsEmailBuilder extends SimplenewsEmailBuilderBase {
    }

    $key = ($message['key'] == 'subscribe_combined') ? 'subscribe' : 'validate';
    return $factory->newModuleEmail('simplenews', $key, $message['params']['context']['simplenews_subscriber']);
    return $factory->newTypedEmail('simplenews', $key, $message['params']['context']['simplenews_subscriber']);
  }

  /**
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ use Drupal\symfony_mailer\Entity\MailerPolicy;
 *     "node" = @Translation("Issue"),
 *   },
 *   has_entity = TRUE,
 *   proxy = TRUE,
 *   common_adjusters = {"email_subject", "email_from"},
 *   import = @Translation("Simplenews newsletter settings"),
 * )
Loading