Commit de064918 authored by Adam Shepherd's avatar Adam Shepherd Committed by Adam Shepherd
Browse files

Issue #3264279 by AdamPS: Send email as plaintext

parent a8c1a177
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -203,6 +203,10 @@ symfony_mailer.email_adjuster_plugin.mailer_inline_css:
  type: mapping
  label: 'Inline CSS'

symfony_mailer.email_adjuster_plugin.mailer_plain_only:
  type: mapping
  label: 'Plain text only'

symfony_mailer.email_adjuster_plugin.mailer_url_to_absolute:
  type: mapping
  label: 'URL to absolute'
+27 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\symfony_mailer\Plugin\EmailAdjuster;

use Drupal\symfony_mailer\Processor\EmailAdjusterBase;
use Drupal\symfony_mailer\EmailInterface;

/**
 * Defines the Plain text only Email Adjuster.
 *
 * @EmailAdjuster(
 *   id = "mailer_plain_only",
 *   label = @Translation("Plain text only"),
 *   description = @Translation("Sends email as plain text only."),
 *   weight = 810,
 * )
 */
class PlainOnlyEmailAdjuster extends EmailAdjusterBase {

  /**
   * {@inheritdoc}
   */
  public function postRender(EmailInterface $email) {
    $email->setHtmlBody(NULL);
  }

}