You are here

class SimpleMail in Simple Mail 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Mail/SimpleMail.php \Drupal\simple_mail\Plugin\Mail\SimpleMail

Simple Mail backend.

Plugin annotation


@Mail(
  id = "simple_mail",
  label = @Translation("Simple Mail"),
  description = @Translation("Send message with HTML mail or plain text.")
)

Hierarchy

Expanded class hierarchy of SimpleMail

File

src/Plugin/Mail/SimpleMail.php, line 18

Namespace

Drupal\simple_mail\Plugin\Mail
View source
class SimpleMail extends PhpMail implements MailInterface {

  /**
   * {@inheritdoc}
   */
  public function format(array $message) {

    // Join the body array into one string.
    $message['body'] = implode("\n\n", $message['body']);

    // Wrap the mail body for sending.
    $message['body'] = MailFormatHelper::wrapMail($message['body']);
    return $message;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PhpMail::$configFactory protected property The configuration factory.
PhpMail::mail public function Sends an email message. Overrides MailInterface::mail 2
PhpMail::_isShellSafe protected static function Disallows potentially unsafe shell characters.
PhpMail::__construct public function PhpMail constructor.
SimpleMail::format public function Concatenates and wraps the email body for plain-text mails. Overrides PhpMail::format