UserFrosting API

MailMessage

MailMessage Class.

Represents a basic mail message, containing a static subject and body.

Tags
author

Alex Weissman (https://alexanderweissman.com)

Table of Contents

$fromEmail string
$fromName string
$recipients \UserFrosting\Sprinkle\Core\Mail\EmailRecipient[]
$replyEmail string
$replyName string
renderBody() Gets the fully rendered text of the message body. string
renderSubject() Gets the fully rendered text of the message subject. string
addEmailRecipient() Add an email recipient. mixed
clearRecipients() Clears out all recipients for this message. mixed
from() Set sender information for this message. mixed
getFromEmail() Get the sender email address. string
getFromName() Get the sender name. Defaults to the email address if name is not set. string
getRecipients() Get the list of recipients for this message. \UserFrosting\Sprinkle\Core\Mail\EmailRecipient[]
getReplyEmail() Get the 'reply-to' address for this message. Defaults to the sender email. string
getReplyName() Get the 'reply-to' name for this message. Defaults to the sender name. string
setFromEmail() Set the sender email address. mixed
setFromName() Set the sender name. mixed
setReplyEmail() Set the sender 'reply-to' address. mixed
setReplyName() Set the sender 'reply-to' name. mixed

Properties

$recipients

protected \UserFrosting\Sprinkle\Core\Mail\EmailRecipient[] $recipients = []

Methods

renderBody()

Gets the fully rendered text of the message body.

public abstract renderBody( [ $params : array = [] ] ) : string
Parameters
$params : array = []
Return values
string

renderSubject()

Gets the fully rendered text of the message subject.

public abstract renderSubject( [ $params : array = [] ] ) : string
Parameters
$params : array = []
Return values
string

clearRecipients()

Clears out all recipients for this message.

public clearRecipients( ) : mixed
Return values
mixed

from()

Set sender information for this message.

public from( [ $fromInfo : string = [] ] ) : mixed

This is a shortcut for calling setFromEmail, setFromName, setReplyEmail, and setReplyName.

Parameters
$fromInfo : string = []

An array containing 'email', 'name', 'reply_email', and 'reply_name'.

Return values
mixed

getFromEmail()

Get the sender email address.

public getFromEmail( ) : string
Return values
string

getFromName()

Get the sender name. Defaults to the email address if name is not set.

public getFromName( ) : string
Return values
string

getRecipients()

Get the list of recipients for this message.

public getRecipients( ) : \UserFrosting\Sprinkle\Core\Mail\EmailRecipient[]
Return values
\UserFrosting\Sprinkle\Core\Mail\EmailRecipient[]

getReplyEmail()

Get the 'reply-to' address for this message. Defaults to the sender email.

public getReplyEmail( ) : string
Return values
string

getReplyName()

Get the 'reply-to' name for this message. Defaults to the sender name.

public getReplyName( ) : string
Return values
string

setFromEmail()

Set the sender email address.

public setFromEmail( $fromEmail : string ) : mixed
Parameters
$fromEmail : string
Return values
mixed

setFromName()

Set the sender name.

public setFromName( $fromName : string ) : mixed
Parameters
$fromName : string
Return values
mixed

setReplyEmail()

Set the sender 'reply-to' address.

public setReplyEmail( $replyEmail : string ) : mixed
Parameters
$replyEmail : string
Return values
mixed

setReplyName()

Set the sender 'reply-to' name.

public setReplyName( $replyName : string ) : mixed
Parameters
$replyName : string
Return values
mixed

Search results