MailMessage

class MailMessage extends SimpleMessage (View source)

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.

from SimpleMessage
$this error()

Indicate that the notification gives information about an error.

from SimpleMessage
$this level(string $level)

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

from SimpleMessage
$this subject(string $subject)

Set the subject of the notification.

from SimpleMessage
$this greeting(string $greeting)

Set the greeting of the notification.

from SimpleMessage
$this salutation(string $salutation)

Set the salutation of the notification.

from SimpleMessage
$this line(Action|string $line)

Add a line of text to the notification.

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

Add a line of text to the notification.

from SimpleMessage
string formatLine(string|array $line)

Format the given line of text.

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

Configure the "call to action" button.

from SimpleMessage
array toArray()

Get an array representation of the message.

from SimpleMessage
$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 template(string $template)

Set the default markdown template.

$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

$this success()

Indicate that the notification gives information about a successful operation.

Return Value

$this

$this error()

Indicate that the notification gives information about an error.

Return Value

$this

$this level(string $level)

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

Parameters

string $level

Return Value

$this

$this subject(string $subject)

Set the subject of the notification.

Parameters

string $subject

Return Value

$this

$this greeting(string $greeting)

Set the greeting of the notification.

Parameters

string $greeting

Return Value

$this

$this salutation(string $salutation)

Set the salutation of the notification.

Parameters

string $salutation

Return Value

$this

$this line(Action|string $line)

Add a line of text to the notification.

Parameters

Action|string $line

Return Value

$this

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

Add a line of text to the notification.

Parameters

Action|string|array $line

Return Value

$this

protected string formatLine(string|array $line)

Format the given line of text.

Parameters

string|array $line

Return Value

string

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

Configure the "call to action" button.

Parameters

string $text
string $url

Return Value

$this

array toArray()

Get an array representation of the message.

Return Value

array

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

Set the view for the mail message.

Parameters

array|string $view
array $data

Return Value

$this

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

Set the Markdown template for the notification.

Parameters

string $view
array $data

Return Value

$this

$this template(string $template)

Set the default markdown template.

Parameters

string $template

Return Value

$this

$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

$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

$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

$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

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

Attach a file to the message.

Parameters

string $file
array $options

Return Value

$this

$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

$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

array data()

Get the data array for the mail message.

Return Value

array

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.5/Illuminate/Notifications/Messages/MailMessage.html