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 }
Stores a single person's name and email address.
Definition: MailAddress.php:36
send( $to, MailAddress $from, string $subject, string $bodyText, ?string $bodyHtml=null, array $options=[])
Definition: Emailer.php:43
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition: StatusValue.php:46
Collection of static functions for sending mail.
Definition: UserMailer.php:35
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:98
Interface for sending emails.
Definition: IEmailer.php:34