TwigMailMessage extends MailMessage
MailMessage Class.
Represents a basic mail message, containing a static subject and body.
Tags
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
$params
protected
array
$params
$template
protected
Template
$template
$view
protected
Twig
$view
$fromEmail
protected
string
$fromEmail
= ''
$fromName
protected
string
$fromName
= null
$recipients
protected
\UserFrosting\Sprinkle\Core\Mail\EmailRecipient[]
$recipients
= []
$replyEmail
protected
string
$replyEmail
= null
$replyName
protected
string
$replyName
= null
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
mixedaddParams()
Merge in any additional global Twig variables to use when rendering this message.
public
addParams(
[ $params :
array
= [] ]
)
: mixed
Parameters
- $params : array = []
Return values
mixedrenderSubject()
Gets the fully rendered text of the message subject.
public
renderSubject(
[ $params :
mixed
= [] ]
)
: string
Parameters
- $params : mixed = []
Return values
stringrenderBody()
Gets the fully rendered text of the message body.
public
renderBody(
[ $params :
mixed
= [] ]
)
: string
Parameters
- $params : mixed = []
Return values
stringsetTemplate()
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
mixedrenderBody()
Gets the fully rendered text of the message body.
public
abstract renderBody(
[ $params :
array
= [] ]
)
: string
Parameters
- $params : array = []
Return values
stringrenderSubject()
Gets the fully rendered text of the message subject.
public
abstract renderSubject(
[ $params :
array
= [] ]
)
: string
Parameters
- $params : array = []
Return values
stringaddEmailRecipient()
Add an email recipient.
public
addEmailRecipient(
$recipient :
EmailRecipient
)
: mixed
Parameters
- $recipient : EmailRecipient
Return values
mixedclearRecipients()
Clears out all recipients for this message.
public
clearRecipients(
)
: mixed
Return values
mixedfrom()
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
mixedgetFromEmail()
Get the sender email address.
public
getFromEmail(
)
: string
Return values
stringgetFromName()
Get the sender name. Defaults to the email address if name is not set.
public
getFromName(
)
: string
Return values
stringgetRecipients()
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
stringgetReplyName()
Get the 'reply-to' name for this message. Defaults to the sender name.
public
getReplyName(
)
: string
Return values
stringsetFromEmail()
Set the sender email address.
public
setFromEmail(
$fromEmail :
string
)
: mixed
Parameters
- $fromEmail : string
Return values
mixedsetFromName()
Set the sender name.
public
setFromName(
$fromName :
string
)
: mixed
Parameters
- $fromName : string
Return values
mixedsetReplyEmail()
Set the sender 'reply-to' address.
public
setReplyEmail(
$replyEmail :
string
)
: mixed
Parameters
- $replyEmail : string
Return values
mixedsetReplyName()
Set the sender 'reply-to' name.
public
setReplyName(
$replyName :
string
)
: mixed
Parameters
- $replyName : string