You are here

class YamlFormPhpMail in YAML Form 8

Extend's the default Drupal mail backend to support HTML email.

Plugin annotation


@Mail(
  id = "yamlform_php_mail",
  label = @Translation("Form PHP mailer"),
  description = @Translation("Sends the message as plain text or HTML, using PHP's native mail() function.")
)

Hierarchy

Expanded class hierarchy of YamlFormPhpMail

File

src/Plugin/Mail/YamlFormPhpMail.php, line 16

Namespace

Drupal\yamlform\Plugin\Mail
View source
class YamlFormPhpMail extends PhpMail {

  /**
   * {@inheritdoc}
   */
  public function format(array $message) {
    if (!empty($message['params']['html'])) {
      $message['body'] = implode("\n\n", $message['body']);
      return $message;
    }
    else {
      return parent::format($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.
YamlFormPhpMail::format public function Concatenates and wraps the email body for plain-text mails. Overrides PhpMail::format