Commit 9250683d authored by Adam Shepherd's avatar Adam Shepherd
Browse files

Issue #3281732 by znerol, AdamPS: Switch back current theme and current user...

Issue #3281732 by znerol, AdamPS: Switch back current theme and current user after exceptions thrown in the {pre-,post-}rendering phase
parent f66c0957
Loading
Loading
Loading
Loading
+4 −1
Changes for src/Mailer.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ class Mailer implements MailerInterface {
      $this->changeActiveLanguage($langcode);
    }

    try {
      // Process the pre-render phase.
      $email->process();

@@ -208,7 +209,8 @@ class Mailer implements MailerInterface {

      // Process the post-render phase.
      $email->process();

    }
    finally {
      // Switch back.
      if ($must_switch_account) {
        $this->accountSwitcher->switchBack();
@@ -221,6 +223,7 @@ class Mailer implements MailerInterface {
      if ($must_switch_theme) {
        $this->changeTheme($active_theme_name);
      }
    }

    try {
      // Send.