MediaWiki master
MediaWiki\Mail\ConfirmEmail\ConfirmEmailContent Class Reference

Value class defining an email sent to the user. More...

Public Member Functions

 __construct (private string $subject, private string $plaintext, private ?string $html=null,)
 
 getHtml ()
 HTML version of the email.
 
 getPlaintext ()
 Plaintext version of the email.
 
 getSubject ()
 Email subject.
 
 toArray ()
 Format the email in a format acceptable by the hook.
 

Static Public Member Functions

static newFromArray (array $data)
 

Detailed Description

Value class defining an email sent to the user.

Currently only used for sending confirmation emails.

Todo
Despite the name, this class probably can be generalised and passed to IEmailer and/or UserMailer.
See also
UserMailer
IEmailer

Definition at line 20 of file ConfirmEmailContent.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Mail\ConfirmEmail\ConfirmEmailContent::__construct ( private string $subject,
private string $plaintext,
private ?string $html = null )

Definition at line 22 of file ConfirmEmailContent.php.

Member Function Documentation

◆ getHtml()

MediaWiki\Mail\ConfirmEmail\ConfirmEmailContent::getHtml ( )

HTML version of the email.

Returns
string|null Null if HTML version is not available

Definition at line 48 of file ConfirmEmailContent.php.

◆ getPlaintext()

MediaWiki\Mail\ConfirmEmail\ConfirmEmailContent::getPlaintext ( )

Plaintext version of the email.

Definition at line 39 of file ConfirmEmailContent.php.

◆ getSubject()

MediaWiki\Mail\ConfirmEmail\ConfirmEmailContent::getSubject ( )

Email subject.

Definition at line 32 of file ConfirmEmailContent.php.

◆ newFromArray()

static MediaWiki\Mail\ConfirmEmail\ConfirmEmailContent::newFromArray ( array $data)
static
Parameters
array$dataSupported keys are subject and body; body can be a string (then it is interpreted as a plaintext message) or an array (then it must have both the text and html keys, with plaintext and HTML versions of the message respectively)
Returns
self

Definition at line 58 of file ConfirmEmailContent.php.

◆ toArray()

MediaWiki\Mail\ConfirmEmail\ConfirmEmailContent::toArray ( )

Format the email in a format acceptable by the hook.

See also
UserSendConfirmationMailHook

Definition at line 90 of file ConfirmEmailContent.php.


The documentation for this class was generated from the following file: