MediaWiki  master
Emailer.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\Mail;
22 
23 use MailAddress;
24 use StatusValue;
25 use UserMailer;
26 
31 class Emailer implements IEmailer {
32 
43  public function send(
44  $to,
45  MailAddress $from,
46  string $subject,
47  string $bodyText,
48  ?string $bodyHtml = null,
49  array $options = []
50  ): StatusValue {
51  $body = $bodyHtml ? [ 'text' => $bodyText, 'html' => $bodyHtml ] : $bodyText;
52  return UserMailer::send( $to, $from, $subject, $body, $options );
53  }
54 }
StatusValue
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition: StatusValue.php:43
UserMailer\send
static send( $to, $from, $subject, $body, $options=[])
This function will perform a direct (authenticated) login to a SMTP Server to use for mail relaying i...
Definition: UserMailer.php:115
MediaWiki\Mail\Emailer\send
send( $to, MailAddress $from, string $subject, string $bodyText, ?string $bodyHtml=null, array $options=[])
Definition: Emailer.php:43
MediaWiki\Mail
Definition: Emailer.php:21
MailAddress
Stores a single person's name and email address.
Definition: MailAddress.php:36
UserMailer
Collection of static functions for sending mail.
Definition: UserMailer.php:30
MediaWiki\Mail\Emailer
Definition: Emailer.php:31
MediaWiki\Mail\IEmailer
Interface for sending emails.
Definition: IEmailer.php:34