MediaWiki master
Emailer.php
Go to the documentation of this file.
1<?php
22
23use MailAddress;
24use StatusValue;
25use UserMailer;
26
42class Emailer implements IEmailer {
43
54 public function send(
55 $to,
56 MailAddress $from,
57 string $subject,
58 string $bodyText,
59 ?string $bodyHtml = null,
60 array $options = []
61 ): StatusValue {
62 $body = $bodyHtml ? [ 'text' => $bodyText, 'html' => $bodyHtml ] : $bodyText;
63 return UserMailer::send( $to, $from, $subject, $body, $options );
64 }
65}
Represent and format a single name and email address pair for SMTP.
Send arbitrary emails.
Definition Emailer.php:42
send( $to, MailAddress $from, string $subject, string $bodyText, ?string $bodyHtml=null, array $options=[])
Definition Emailer.php:54
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Collection of static functions for sending mail.
static send( $to, $from, $subject, $body, $options=[])
Send a raw email via SMTP (if $wgSMTP is set) or otherwise via PHP mail().
Interface for sending arbitrary emails.
Definition IEmailer.php:35