UserFrosting API

TwigMailMessage extends MailMessage

MailMessage Class.

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

Tags
author

Alex Weissman (https://alexanderweissman.com)

Table of Contents

$params array
$template Template
$view Twig
$fromEmail string
$fromName string
$recipients \UserFrosting\Sprinkle\Core\Mail\EmailRecipient[]
$replyEmail string
$replyName string
__construct() Create a new TwigMailMessage instance. mixed
addParams() Merge in any additional global Twig variables to use when rendering this message. mixed
renderSubject() Gets the fully rendered text of the message subject. string
renderBody() Gets the fully rendered text of the message body. string
setTemplate() Sets the Twig template object for this message. mixed
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

__construct()

Create a new TwigMailMessage instance.

public __construct( $view : Twig [, $filename : string = null ] ) : mixed
Parameters
$view : Twig

The Twig view object used to render mail templates.

$filename : string = null

optional Set the Twig template to use for this message.

Return values
mixed

addParams()

Merge in any additional global Twig variables to use when rendering this message.

public addParams( [ $params : array = [] ] ) : mixed
Parameters
$params : array = []
Return values
mixed

renderSubject()

Gets the fully rendered text of the message subject.

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

renderBody()

Gets the fully rendered text of the message body.

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

setTemplate()

Sets the Twig template object for this message.

public setTemplate( $template : Template ) : mixed
Parameters
$template : Template

The Twig template object, to source the content for this message.

Return values
mixed

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