class SimpleMessage (View source)

Properties

string $level

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

string $subject

The subject of the notification.

string $greeting

The notification's greeting.

string $salutation

The notification's salutation.

array $introLines

The "intro" lines of the notification.

array $outroLines

The "outro" lines of the notification.

string $actionText

The text / label for the action.

string $actionUrl

The action URL.

string $mailer

The name of the mailer that should send the notification.

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(mixed $line)

Add a line of text to the notification.

$this
lineIf(bool $boolean, mixed $line)

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

$this
lines(iterable $lines)

Add lines of text to the notification.

$this
linesIf(bool $boolean, iterable $lines)

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

$this
with(mixed $line)

Add a line of text to the notification.

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

Format the given line of text.

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

Configure the "call to action" button.

$this
mailer(string $mailer)

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

array
toArray()

Get an array representation of the 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(mixed $line)

Add a line of text to the notification.

Parameters

mixed $line

Return Value

$this

$this 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

$this

$this lines(iterable $lines)

Add lines of text to the notification.

Parameters

iterable $lines

Return Value

$this

$this 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

$this

$this with(mixed $line)

Add a line of text to the notification.

Parameters

mixed $line

Return Value

$this

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

Format the given line of text.

Parameters

Htmlable|string|array $line

Return Value

Htmlable|string

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

Configure the "call to action" button.

Parameters

string $text
string $url

Return Value

$this

$this mailer(string $mailer)

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

Parameters

string $mailer

Return Value

$this

array toArray()

Get an array representation of the message.

Return Value

array