Commit 099d2e17 authored by Adam Shepherd's avatar Adam Shepherd
Browse files

Issue #3277690 by AdamPS: Improvements to phase/weight of processors

parent c1cb9796
Loading
Loading
Loading
Loading
+0 −2
Changes for src/EmailInterface.php: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -12,8 +12,6 @@ interface EmailInterface extends BaseEmailInterface {

  /**
   * The default weight for an email processor.
   *
   * Set processors and parameters.
   */
  const DEFAULT_WEIGHT = 500;

+1 −1
Changes for src/Plugin/EmailAdjuster/AddressAdjusterBase.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ abstract class AddressAdjusterBase extends EmailAdjusterBase {
  /**
   * {@inheritdoc}
   */
  public function postRender(EmailInterface $email) {
  public function build(EmailInterface $email) {
    foreach ($this->configuration['addresses'] as $item) {
      $value = $item['value'];
      $display = $item['display'];
+1 −1
Changes for src/Plugin/EmailAdjuster/PlainEmailAdjuster.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class PlainEmailAdjuster extends EmailAdjusterBase {
  /**
   * {@inheritdoc}
   */
  public function postRender(EmailInterface $email) {
  public function build(EmailInterface $email) {
    $email->setTextBody($this->configuration['value']);
  }

+1 −1
Changes for src/Plugin/EmailAdjuster/PriorityEmailAdjuster.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class PriorityEmailAdjuster extends EmailAdjusterBase {
  /**
   * {@inheritdoc}
   */
  public function postRender(EmailInterface $email) {
  public function build(EmailInterface $email) {
    $priority = $this->configuration['value'];
    $email->setPriority($priority);
  }
+0 −10
Changes for src/Plugin/EmailAdjuster/ToEmailAdjuster.php: 0 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ use Drupal\symfony_mailer\EmailInterface;
 *   id = "email_to",
 *   label = @Translation("To"),
 *   description = @Translation("Sets the email to header."),
 *   weight = 200,
 * )
 */
class ToEmailAdjuster extends AddressAdjusterBase {
@@ -21,13 +20,4 @@ class ToEmailAdjuster extends AddressAdjusterBase {
   */
  protected const NAME = 'To';

  /**
   * {@inheritdoc}
   */
  public function init(EmailInterface $email) {
    // The to address can be used to default the recipient account. Ensure that
    // it is set early enough to do this.
    $email->addProcessor($this->getPluginId(), EmailInterface::PHASE_BUILD, [$this, 'postRender'], $this->getWeight(EmailInterface::PHASE_BUILD));
  }

}
Loading