You are here

UbercartMail.php in Ubercart 8.4

File

uc_store/src/Plugin/Mail/UbercartMail.php
View source
<?php

namespace Drupal\uc_store\Plugin\Mail;

use Drupal\Core\Mail\Plugin\Mail\PhpMail;

/**
 * Modifies the Drupal mail system to send HTML emails.
 *
 * @Mail(
 *   id = "ubercart_mail",
 *   label = @Translation("Ubercart mailer"),
 *   description = @Translation("Sends the message as HTML, using PHP's native mail() function.")
 * )
 */
class UbercartMail extends PhpMail {

  /**
   * Concatenates the e-mail body for HTML mails.
   *
   * @param array $message
   *   A message array, as described in hook_mail_alter().
   *
   * @return string
   *   The formatted $message.
   */
  public function format(array $message) {
    $message['body'] = implode("\n\n", $message['body']);
    return $message;
  }

}

Classes

Namesort descending Description
UbercartMail Modifies the Drupal mail system to send HTML emails.