class MailMessage extends SimpleMessage

Properties

string $level

The "level" of the notification (info, success, error).

from  SimpleMessage
string $subject

The subject of the notification.

from  SimpleMessage
string $greeting

The notification's greeting.

from  SimpleMessage
string $salutation

The notification's salutation.

from  SimpleMessage
array $introLines

The "intro" lines of the notification.

from  SimpleMessage
array $outroLines

The "outro" lines of the notification.

from  SimpleMessage
string $actionText

The text / label for the action.

from  SimpleMessage
string $actionUrl

The action URL.

from  SimpleMessage
array|string $view

The view to be rendered.

array $viewData

The view data for the message.

string|null $markdown

The Markdown template to render (if applicable).

array $from

The "from" information for the message.

array $replyTo

The "reply to" information for the message.

array $cc

The "cc" information for the message.

array $bcc

The "bcc" information for the message.

array $attachments

The attachments for the message.

array $rawAttachments

The raw attachments for the message.

int $priority

Priority level of the message.

Methods

$this
success()

Indicate that the notification gives information about a successful operation.

$this
error()

Indicate that the notification gives information about an error.

$this
level(string $level)

Set the "level" of the notification (success, error, etc.).

$this
subject(string $subject)

Set the subject of the notification.

$this
greeting(string $greeting)

Set the greeting of the notification.

$this
salutation(string $salutation)

Set the salutation of the notification.

$this
line(Action|string $line)

Add a line of text to the notification.

$this
with(Action|string|array $line)

Add a line of text to the notification.

string
formatLine(string|array $line)

Format the given line of text.

$this
action(string $text, string $url)

Configure the "call to action" button.

array
toArray()

Get an array representation of the message.

$this
view(array|string $view, array $data = [])

Set the view for the mail message.

$this
markdown(string $view, array $data = [])

Set the Markdown template for the notification.

$this
from(string $address, string|null $name = null)

Set the from address for the mail message.

$this
replyTo(array|string $address, string|null $name = null)

Set the "reply to" address of the message.

$this
cc(string $address, string|null $name = null)

Set the cc address for the mail message.

$this
bcc(string $address, string|null $name = null)

Set the bcc address for the mail message.

$this
attach(string $file, array $options = [])

Attach a file to the message.

$this
attachData(string $data, string $name, array $options = [])

Attach in-memory data as an attachment.

$this
priority(int $level)

Set the priority of this message.

array
data()

Get the data array for the mail message.

Details

in SimpleMessage at line 70
$this success()

Indicate that the notification gives information about a successful operation.

Return Value

$this

in SimpleMessage at line 82
$this error()

Indicate that the notification gives information about an error.

Return Value

$this

in SimpleMessage at line 95
$this level(string $level)

Set the "level" of the notification (success, error, etc.).

Parameters

string $level

Return Value

$this

in SimpleMessage at line 108
$this subject(string $subject)

Set the subject of the notification.

Parameters

string $subject

Return Value

$this

in SimpleMessage at line 121
$this greeting(string $greeting)

Set the greeting of the notification.

Parameters

string $greeting

Return Value

$this

in SimpleMessage at line 134
$this salutation(string $salutation)

Set the salutation of the notification.

Parameters

string $salutation

Return Value

$this

in SimpleMessage at line 147
$this line(Action|string $line)

Add a line of text to the notification.

Parameters

Action|string $line

Return Value

$this

in SimpleMessage at line 158
$this with(Action|string|array $line)

Add a line of text to the notification.

Parameters

Action|string|array $line

Return Value

$this

in SimpleMessage at line 177
protected string formatLine(string|array $line)

Format the given line of text.

Parameters

string|array $line

Return Value

string

in SimpleMessage at line 193
$this action(string $text, string $url)

Configure the "call to action" button.

Parameters

string $text
string $url

Return Value

$this

in SimpleMessage at line 206
array toArray()

Get an array representation of the message.

Return Value

array

at line 84
$this view(array|string $view, array $data = [])

Set the view for the mail message.

Parameters

array|string $view
array $data

Return Value

$this

at line 101
$this markdown(string $view, array $data = [])

Set the Markdown template for the notification.

Parameters

string $view
array $data

Return Value

$this

at line 118
$this from(string $address, string|null $name = null)

Set the from address for the mail message.

Parameters

string $address
string|null $name

Return Value

$this

at line 132
$this replyTo(array|string $address, string|null $name = null)

Set the "reply to" address of the message.

Parameters

array|string $address
string|null $name

Return Value

$this

at line 146
$this cc(string $address, string|null $name = null)

Set the cc address for the mail message.

Parameters

string $address
string|null $name

Return Value

$this

at line 160
$this bcc(string $address, string|null $name = null)

Set the bcc address for the mail message.

Parameters

string $address
string|null $name

Return Value

$this

at line 174
$this attach(string $file, array $options = [])

Attach a file to the message.

Parameters

string $file
array $options

Return Value

$this

at line 189
$this attachData(string $data, string $name, array $options = [])

Attach in-memory data as an attachment.

Parameters

string $data
string $name
array $options

Return Value

$this

at line 204
$this priority(int $level)

Set the priority of this message.

The value is an integer where 1 is the highest priority and 5 is the lowest.

Parameters

int $level

Return Value

$this

at line 216
array data()

Get the data array for the mail message.

Return Value

array