Loading modules/symfony_mailer_bc/src/MailManagerReplacement.php +3 −3 Changes for modules/symfony_mailer_bc/src/MailManagerReplacement.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -154,16 +154,16 @@ class MailManagerReplacement extends MailManager { if (is_array($message['body'])) { foreach ($message['body'] as $part) { if ($part instanceof MarkupInterface) { $content = ['#markup' => $part]; $body[] = ['#markup' => $part]; } else { $content = [ $body[] = [ '#type' => 'processed_text', '#text' => $part, ]; } $email->appendBody($content); } $email->setBody($body ?? []); } else { $email->setHtmlBody($message['body']); Loading modules/symfony_mailer_bc/src/Plugin/EmailBuilder/ContactEmailBuilderBase.php +1 −1 Changes for modules/symfony_mailer_bc/src/Plugin/EmailBuilder/ContactEmailBuilderBase.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ class ContactEmailBuilderBase extends EmailBuilderBase { $sender = $email->getParam('sender'); $contact_message = $email->getParam('contact_message'); $email->appendBodyEntity($contact_message, 'mail') $email->setBodyEntity($contact_message, 'mail') ->addLibrary('symfony_mailer_bc/contact') ->setVariable('subject', $contact_message->getSubject()) ->setVariable('site_name', \Drupal::config('system.site')->get('name')) Loading modules/symfony_mailer_bc/src/Plugin/EmailBuilder/SimplenewsNewsletterEmailBuilder.php +1 −1 Changes for modules/symfony_mailer_bc/src/Plugin/EmailBuilder/SimplenewsNewsletterEmailBuilder.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class SimplenewsNewsletterEmailBuilder extends SimplenewsEmailBuilderBase { */ public function build(EmailInterface $email) { parent::build($email); $email->appendBodyEntity($email->getParam('issue'), 'email_html') $email->setBodyEntity($email->getParam('issue'), 'email_html') ->addTextHeader('Precedence', 'bulk') ->setVariable('opt_out_hidden', !$email->getEntity()->isAccessible()); Loading src/Email.php +2 −12 Changes for src/Email.php: 2 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -272,21 +272,11 @@ class Email implements InternalEmailInterface { /** * {@inheritdoc} */ public function appendBody($body) { $this->valid(self::PHASE_PRE_RENDER); $name = 'n' . count($this->body); $this->body[$name] = $body; return $this; } /** * {@inheritdoc} */ public function appendBodyEntity(EntityInterface $entity, $view_mode = 'full') { public function setBodyEntity(EntityInterface $entity, $view_mode = 'full') { $this->valid(self::PHASE_PRE_RENDER); $build = $this->entityTypeManager->getViewBuilder($entity->getEntityTypeId()) ->view($entity, $view_mode); $this->appendBody($build); $this->setBody($build); return $this; } Loading src/EmailInterface.php +2 −17 Changes for src/EmailInterface.php: 2 added lines, 17 removed lines. Original line number Diff line number Diff line Loading @@ -180,22 +180,7 @@ interface EmailInterface extends BaseEmailInterface { public function setBody($body); /** * Appends content to the email body array. * * Valid: before rendering. * * @param $body * Unrendered body part to append to the existing body array. * * @return $this */ public function appendBody($body); /** * Appends an entity to the email body array. * * WARNING: rendering as a trusted user can expose private information . Call * ::setAccount() unless you are sure this cannot occur. * Builds the email body array from an entity. * * Valid: before rendering. * Loading @@ -206,7 +191,7 @@ interface EmailInterface extends BaseEmailInterface { * * @return $this */ public function appendBodyEntity(EntityInterface $entity, $view_mode = 'full'); public function setBodyEntity(EntityInterface $entity, $view_mode = 'full'); /** * Gets the unrendered email body array. Loading Loading
modules/symfony_mailer_bc/src/MailManagerReplacement.php +3 −3 Changes for modules/symfony_mailer_bc/src/MailManagerReplacement.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -154,16 +154,16 @@ class MailManagerReplacement extends MailManager { if (is_array($message['body'])) { foreach ($message['body'] as $part) { if ($part instanceof MarkupInterface) { $content = ['#markup' => $part]; $body[] = ['#markup' => $part]; } else { $content = [ $body[] = [ '#type' => 'processed_text', '#text' => $part, ]; } $email->appendBody($content); } $email->setBody($body ?? []); } else { $email->setHtmlBody($message['body']); Loading
modules/symfony_mailer_bc/src/Plugin/EmailBuilder/ContactEmailBuilderBase.php +1 −1 Changes for modules/symfony_mailer_bc/src/Plugin/EmailBuilder/ContactEmailBuilderBase.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ class ContactEmailBuilderBase extends EmailBuilderBase { $sender = $email->getParam('sender'); $contact_message = $email->getParam('contact_message'); $email->appendBodyEntity($contact_message, 'mail') $email->setBodyEntity($contact_message, 'mail') ->addLibrary('symfony_mailer_bc/contact') ->setVariable('subject', $contact_message->getSubject()) ->setVariable('site_name', \Drupal::config('system.site')->get('name')) Loading
modules/symfony_mailer_bc/src/Plugin/EmailBuilder/SimplenewsNewsletterEmailBuilder.php +1 −1 Changes for modules/symfony_mailer_bc/src/Plugin/EmailBuilder/SimplenewsNewsletterEmailBuilder.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class SimplenewsNewsletterEmailBuilder extends SimplenewsEmailBuilderBase { */ public function build(EmailInterface $email) { parent::build($email); $email->appendBodyEntity($email->getParam('issue'), 'email_html') $email->setBodyEntity($email->getParam('issue'), 'email_html') ->addTextHeader('Precedence', 'bulk') ->setVariable('opt_out_hidden', !$email->getEntity()->isAccessible()); Loading
src/Email.php +2 −12 Changes for src/Email.php: 2 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -272,21 +272,11 @@ class Email implements InternalEmailInterface { /** * {@inheritdoc} */ public function appendBody($body) { $this->valid(self::PHASE_PRE_RENDER); $name = 'n' . count($this->body); $this->body[$name] = $body; return $this; } /** * {@inheritdoc} */ public function appendBodyEntity(EntityInterface $entity, $view_mode = 'full') { public function setBodyEntity(EntityInterface $entity, $view_mode = 'full') { $this->valid(self::PHASE_PRE_RENDER); $build = $this->entityTypeManager->getViewBuilder($entity->getEntityTypeId()) ->view($entity, $view_mode); $this->appendBody($build); $this->setBody($build); return $this; } Loading
src/EmailInterface.php +2 −17 Changes for src/EmailInterface.php: 2 added lines, 17 removed lines. Original line number Diff line number Diff line Loading @@ -180,22 +180,7 @@ interface EmailInterface extends BaseEmailInterface { public function setBody($body); /** * Appends content to the email body array. * * Valid: before rendering. * * @param $body * Unrendered body part to append to the existing body array. * * @return $this */ public function appendBody($body); /** * Appends an entity to the email body array. * * WARNING: rendering as a trusted user can expose private information . Call * ::setAccount() unless you are sure this cannot occur. * Builds the email body array from an entity. * * Valid: before rendering. * Loading @@ -206,7 +191,7 @@ interface EmailInterface extends BaseEmailInterface { * * @return $this */ public function appendBodyEntity(EntityInterface $entity, $view_mode = 'full'); public function setBodyEntity(EntityInterface $entity, $view_mode = 'full'); /** * Gets the unrendered email body array. Loading