MailMessage
extends SimpleMessage
in package
Table of Contents
- $actionText : string
- The text / label for the action.
- $actionUrl : string
- The action URL.
- $attachments : array<string|int, mixed>
- The attachments for the message.
- $bcc : array<string|int, mixed>
- The "bcc" information for the message.
- $cc : array<string|int, mixed>
- The "cc" information for the message.
- $from : array<string|int, mixed>
- The "from" information for the message.
- $greeting : string
- The notification's greeting.
- $introLines : array<string|int, mixed>
- The "intro" lines of the notification.
- $level : string
- The "level" of the notification (info, success, error).
- $markdown : string|null
- The Markdown template to render (if applicable).
- $outroLines : array<string|int, mixed>
- The "outro" lines of the notification.
- $priority : int
- Priority level of the message.
- $rawAttachments : array<string|int, mixed>
- The raw attachments for the message.
- $replyTo : array<string|int, mixed>
- The "reply to" information for the message.
- $salutation : string
- The notification's salutation.
- $subject : string
- The subject of the notification.
- $view : array<string|int, mixed>|string
- The view to be rendered.
- $viewData : array<string|int, mixed>
- The view data for the message.
- action() : $this
- Configure the "call to action" button.
- attach() : $this
- Attach a file to the message.
- attachData() : $this
- Attach in-memory data as an attachment.
- bcc() : $this
- Set the bcc address for the mail message.
- cc() : $this
- Set the cc address for the mail message.
- data() : array<string|int, mixed>
- Get the data array for the mail message.
- error() : $this
- Indicate that the notification gives information about an error.
- from() : $this
- Set the from address for the mail message.
- greeting() : $this
- Set the greeting of the notification.
- level() : $this
- Set the "level" of the notification (success, error, etc.).
- line() : $this
- Add a line of text to the notification.
- markdown() : $this
- Set the Markdown template for the notification.
- priority() : $this
- Set the priority of this message.
- replyTo() : $this
- Set the "reply to" address of the message.
- salutation() : $this
- Set the salutation of the notification.
- subject() : $this
- Set the subject of the notification.
- success() : $this
- Indicate that the notification gives information about a successful operation.
- template() : $this
- Set the default markdown template.
- toArray() : array<string|int, mixed>
- Get an array representation of the message.
- view() : $this
- Set the view for the mail message.
- with() : $this
- Add a line of text to the notification.
- formatLine() : Htmlable|string
- Format the given line of text.
Properties
$actionText
The text / label for the action.
public
string
$actionText
$actionUrl
The action URL.
public
string
$actionUrl
$attachments
The attachments for the message.
public
array<string|int, mixed>
$attachments
= []
$bcc
The "bcc" information for the message.
public
array<string|int, mixed>
$bcc
= []
$cc
The "cc" information for the message.
public
array<string|int, mixed>
$cc
= []
$from
The "from" information for the message.
public
array<string|int, mixed>
$from
= []
$greeting
The notification's greeting.
public
string
$greeting
$introLines
The "intro" lines of the notification.
public
array<string|int, mixed>
$introLines
= []
$level
The "level" of the notification (info, success, error).
public
string
$level
= 'info'
$markdown
The Markdown template to render (if applicable).
public
string|null
$markdown
= 'notifications::email'
$outroLines
The "outro" lines of the notification.
public
array<string|int, mixed>
$outroLines
= []
$priority
Priority level of the message.
public
int
$priority
$rawAttachments
The raw attachments for the message.
public
array<string|int, mixed>
$rawAttachments
= []
$replyTo
The "reply to" information for the message.
public
array<string|int, mixed>
$replyTo
= []
$salutation
The notification's salutation.
public
string
$salutation
$subject
The subject of the notification.
public
string
$subject
$view
The view to be rendered.
public
array<string|int, mixed>|string
$view
$viewData
The view data for the message.
public
array<string|int, mixed>
$viewData
= []
Methods
action()
Configure the "call to action" button.
public
action(string $text, string $url) : $this
Parameters
- $text : string
- $url : string
Return values
$this —attach()
Attach a file to the message.
public
attach(string $file[, array<string|int, mixed> $options = [] ]) : $this
Parameters
- $file : string
- $options : array<string|int, mixed> = []
Return values
$this —attachData()
Attach in-memory data as an attachment.
public
attachData(string $data, string $name[, array<string|int, mixed> $options = [] ]) : $this
Parameters
- $data : string
- $name : string
- $options : array<string|int, mixed> = []
Return values
$this —bcc()
Set the bcc address for the mail message.
public
bcc(string $address[, string|null $name = null ]) : $this
Parameters
- $address : string
- $name : string|null = null
Return values
$this —cc()
Set the cc address for the mail message.
public
cc(string $address[, string|null $name = null ]) : $this
Parameters
- $address : string
- $name : string|null = null
Return values
$this —data()
Get the data array for the mail message.
public
data() : array<string|int, mixed>
Return values
array<string|int, mixed> —error()
Indicate that the notification gives information about an error.
public
error() : $this
Return values
$this —from()
Set the from address for the mail message.
public
from(string $address[, string|null $name = null ]) : $this
Parameters
- $address : string
- $name : string|null = null
Return values
$this —greeting()
Set the greeting of the notification.
public
greeting(string $greeting) : $this
Parameters
- $greeting : string
Return values
$this —level()
Set the "level" of the notification (success, error, etc.).
public
level(string $level) : $this
Parameters
- $level : string
Return values
$this —line()
Add a line of text to the notification.
public
line(mixed $line) : $this
Parameters
- $line : mixed
Return values
$this —markdown()
Set the Markdown template for the notification.
public
markdown(string $view[, array<string|int, mixed> $data = [] ]) : $this
Parameters
- $view : string
- $data : array<string|int, mixed> = []
Return values
$this —priority()
Set the priority of this message.
public
priority(int $level) : $this
The value is an integer where 1 is the highest priority and 5 is the lowest.
Parameters
- $level : int
Return values
$this —replyTo()
Set the "reply to" address of the message.
public
replyTo(array<string|int, mixed>|string $address[, string|null $name = null ]) : $this
Parameters
- $address : array<string|int, mixed>|string
- $name : string|null = null
Return values
$this —salutation()
Set the salutation of the notification.
public
salutation(string $salutation) : $this
Parameters
- $salutation : string
Return values
$this —subject()
Set the subject of the notification.
public
subject(string $subject) : $this
Parameters
- $subject : string
Return values
$this —success()
Indicate that the notification gives information about a successful operation.
public
success() : $this
Return values
$this —template()
Set the default markdown template.
public
template(string $template) : $this
Parameters
- $template : string
Return values
$this —toArray()
Get an array representation of the message.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —view()
Set the view for the mail message.
public
view(array<string|int, mixed>|string $view[, array<string|int, mixed> $data = [] ]) : $this
Parameters
- $view : array<string|int, mixed>|string
- $data : array<string|int, mixed> = []
Return values
$this —with()
Add a line of text to the notification.
public
with(mixed $line) : $this
Parameters
- $line : mixed
Return values
$this —formatLine()
Format the given line of text.
protected
formatLine(Htmlable|string|array<string|int, mixed> $line) : Htmlable|string
Parameters
- $line : Htmlable|string|array<string|int, mixed>