MailMessage
MailMessage Class.
Represents a basic mail message, containing a static subject and body.
Tags
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
$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
renderBody()
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