class SimpleMessage

Properties

string $level

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

string|null $subject

The subject of the notification.

string|null $greeting

The notification's greeting.

string|null $salutation

The notification's salutation.

array $introLines

The "intro" lines of the notification.

array $outroLines

The "outro" lines of the notification.

string|null $actionText

The text / label for the action.

string|null $actionUrl

The action URL.

string|null $mailer

The name of the mailer that should send the notification.

Methods

success()

Indicate that the notification gives information about a successful operation.

error()

Indicate that the notification gives information about an error.

level(string $level)

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

subject(string $subject)

Set the subject of the notification.

greeting(string $greeting)

Set the greeting of the notification.

salutation(string $salutation)

Set the salutation of the notification.

line(mixed $line)

Add a line of text to the notification.

lineIf(bool $boolean, mixed $line)

Add a line of text to the notification if the given condition is true.

lines(iterable $lines)

Add lines of text to the notification.

linesIf(bool $boolean, iterable $lines)

Add lines of text to the notification if the given condition is true.

with(mixed $line)

Add a line of text to the notification.

Htmlable|string
formatLine(array|Htmlable|string|null $line)

Format the given line of text.

action(string $text, string $url)

Configure the "call to action" button.

mailer(string $mailer)

Set the name of the mailer that should send the notification.

array
toArray()

Get an array representation of the message.

Details

at line 60
SimpleMessage success()

Indicate that the notification gives information about a successful operation.

Return Value

SimpleMessage

at line 70
SimpleMessage error()

Indicate that the notification gives information about an error.

Return Value

SimpleMessage

at line 80
SimpleMessage level(string $level)

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

Parameters

string $level

Return Value

SimpleMessage

at line 90
SimpleMessage subject(string $subject)

Set the subject of the notification.

Parameters

string $subject

Return Value

SimpleMessage

at line 100
SimpleMessage greeting(string $greeting)

Set the greeting of the notification.

Parameters

string $greeting

Return Value

SimpleMessage

at line 110
SimpleMessage salutation(string $salutation)

Set the salutation of the notification.

Parameters

string $salutation

Return Value

SimpleMessage

at line 120
SimpleMessage line(mixed $line)

Add a line of text to the notification.

Parameters

mixed $line

Return Value

SimpleMessage

at line 128
SimpleMessage lineIf(bool $boolean, mixed $line)

Add a line of text to the notification if the given condition is true.

Parameters

bool $boolean
mixed $line

Return Value

SimpleMessage

at line 140
SimpleMessage lines(iterable $lines)

Add lines of text to the notification.

Parameters

iterable $lines

Return Value

SimpleMessage

at line 152
SimpleMessage linesIf(bool $boolean, iterable $lines)

Add lines of text to the notification if the given condition is true.

Parameters

bool $boolean
iterable $lines

Return Value

SimpleMessage

at line 164
SimpleMessage with(mixed $line)

Add a line of text to the notification.

Parameters

mixed $line

Return Value

SimpleMessage

at line 180
protected Htmlable|string formatLine(array|Htmlable|string|null $line)

Format the given line of text.

Parameters

array|Htmlable|string|null $line

Return Value

Htmlable|string

at line 196
SimpleMessage action(string $text, string $url)

Configure the "call to action" button.

Parameters

string $text
string $url

Return Value

SimpleMessage

at line 207
SimpleMessage mailer(string $mailer)

Set the name of the mailer that should send the notification.

Parameters

string $mailer

Return Value

SimpleMessage

at line 217
array toArray()

Get an array representation of the message.

Return Value

array