Documentation

Mailable
in package
implements Mailable, Renderable

Interfaces, Classes and Traits

Mailable
Renderable

Table of Contents

$attachments  : array<string|int, mixed>
The attachments for the message.
$bcc  : array<string|int, mixed>
The "bcc" recipients of the message.
$callbacks  : array<string|int, mixed>
The callbacks for the message.
$cc  : array<string|int, mixed>
The "cc" recipients of the message.
$from  : array<string|int, mixed>
The person the message is from.
$rawAttachments  : array<string|int, mixed>
The raw attachments for the message.
$replyTo  : array<string|int, mixed>
The "reply to" recipients of the message.
$subject  : string
The subject of the message.
$textView  : string
The plain text view to use for the message.
$to  : array<string|int, mixed>
The "to" recipients of the message.
$view  : string
The view to use for the message.
$viewData  : array<string|int, mixed>
The view data for the message.
$markdown  : string
The Markdown template for the message (if applicable).
__call()  : $this
Dynamically bind parameters to the message.
attach()  : $this
Attach a file to the message.
attachData()  : $this
Attach in-memory data as an attachment.
bcc()  : $this
Set the recipients of the message.
buildViewData()  : array<string|int, mixed>
Build the view data for the message.
cc()  : $this
Set the recipients of the message.
from()  : $this
Set the sender of the message.
hasBcc()  : bool
Determine if the given recipient is set on the mailable.
hasCc()  : bool
Determine if the given recipient is set on the mailable.
hasFrom()  : bool
Determine if the given recipient is set on the mailable.
hasReplyTo()  : bool
Determine if the given recipient is set on the mailable.
hasTo()  : bool
Determine if the given recipient is set on the mailable.
later()  : mixed
Deliver the queued message after the given delay.
markdown()  : $this
Set the Markdown template for the message.
priority()  : $this
Set the priority of this message.
queue()  : mixed
Queue the message for sending.
render()  : string
Render the mailable into a view.
replyTo()  : $this
Set the "reply to" address of the message.
send()  : void
Send the message using the given mailer.
subject()  : $this
Set the subject of the message.
text()  : $this
Set the plain text view for the message.
to()  : $this
Set the recipients of the message.
view()  : $this
Set the view and view data for the message.
with()  : $this
Set the view data for the message.
withSwiftMessage()  : $this
Register a callback to be called with the Swift message instance.
addressesToArray()  : array<string|int, mixed>
Convert the given recipient arguments to an array.
buildAttachments()  : $this
Add all of the attachments to the message.
buildFrom()  : $this
Add the sender to the message.
buildMarkdownText()  : string
Build the text view for a Markdown message.
buildMarkdownView()  : array<string|int, mixed>
Build the Markdown view for the message.
buildRecipients()  : $this
Add all of the recipients to the message.
buildSubject()  : $this
Set the subject for the message.
buildView()  : array<string|int, mixed>|string
Build the view for the message.
hasRecipient()  : bool
Determine if the given recipient is set on the mailable.
normalizeRecipient()  : object
Convert the given recipient into an object.
runCallbacks()  : $this
Run the callbacks for the message.
setAddress()  : $this
Set the recipients of the message.

Properties

$attachments

The attachments for the message.

public array<string|int, mixed> $attachments = []

$bcc

The "bcc" recipients of the message.

public array<string|int, mixed> $bcc = []

$callbacks

The callbacks for the message.

public array<string|int, mixed> $callbacks = []

$cc

The "cc" recipients of the message.

public array<string|int, mixed> $cc = []

$from

The person the message is from.

public array<string|int, mixed> $from = []

$rawAttachments

The raw attachments for the message.

public array<string|int, mixed> $rawAttachments = []

$replyTo

The "reply to" recipients of the message.

public array<string|int, mixed> $replyTo = []

$subject

The subject of the message.

public string $subject

$textView

The plain text view to use for the message.

public string $textView

$to

The "to" recipients of the message.

public array<string|int, mixed> $to = []

$view

The view to use for the message.

public string $view

$viewData

The view data for the message.

public array<string|int, mixed> $viewData = []

$markdown

The Markdown template for the message (if applicable).

protected string $markdown

Methods

__call()

Dynamically bind parameters to the message.

public __call(string $method, array<string|int, mixed> $parameters) : $this
Parameters
$method : string
$parameters : array<string|int, mixed>
Tags
throws
BadMethodCallException
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 recipients of the message.

public bcc(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : $this
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
$this

buildViewData()

Build the view data for the message.

public buildViewData() : array<string|int, mixed>
Return values
array<string|int, mixed>

cc()

Set the recipients of the message.

public cc(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : $this
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
$this

from()

Set the sender of the message.

public from(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : $this
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
$this

hasBcc()

Determine if the given recipient is set on the mailable.

public hasBcc(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : bool
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
bool

hasCc()

Determine if the given recipient is set on the mailable.

public hasCc(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : bool
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
bool

hasFrom()

Determine if the given recipient is set on the mailable.

public hasFrom(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : bool
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
bool

hasReplyTo()

Determine if the given recipient is set on the mailable.

public hasReplyTo(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : bool
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
bool

hasTo()

Determine if the given recipient is set on the mailable.

public hasTo(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : bool
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
bool

later()

Deliver the queued message after the given delay.

public later(DateTimeInterface|DateInterval|int $delay, Factory $queue) : mixed
Parameters
$delay : DateTimeInterface|DateInterval|int
$queue : Factory
Return values
mixed

markdown()

Set the Markdown template for the message.

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 = 3 ]) : $this

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

Parameters
$level : int = 3
Return values
$this

queue()

Queue the message for sending.

public queue(Factory $queue) : mixed
Parameters
$queue : Factory
Return values
mixed

render()

Render the mailable into a view.

public render() : string
Return values
string

replyTo()

Set the "reply to" address of the message.

public replyTo(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : $this
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
$this

send()

Send the message using the given mailer.

public send(Mailer $mailer) : void
Parameters
$mailer : Mailer
Return values
void

subject()

Set the subject of the message.

public subject(string $subject) : $this
Parameters
$subject : string
Return values
$this

text()

Set the plain text view for the message.

public text(string $textView[, array<string|int, mixed> $data = [] ]) : $this
Parameters
$textView : string
$data : array<string|int, mixed> = []
Return values
$this

to()

Set the recipients of the message.

public to(object|array<string|int, mixed>|string $address[, string|null $name = null ]) : $this
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
Return values
$this

view()

Set the view and view data for the message.

public view(string $view[, array<string|int, mixed> $data = [] ]) : $this
Parameters
$view : string
$data : array<string|int, mixed> = []
Return values
$this

with()

Set the view data for the message.

public with(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
Parameters
$key : string|array<string|int, mixed>
$value : mixed = null
Return values
$this

withSwiftMessage()

Register a callback to be called with the Swift message instance.

public withSwiftMessage(callable $callback) : $this
Parameters
$callback : callable
Return values
$this

addressesToArray()

Convert the given recipient arguments to an array.

protected addressesToArray(object|array<string|int, mixed>|string $address, string|null $name) : array<string|int, mixed>
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null
Return values
array<string|int, mixed>

buildAttachments()

Add all of the attachments to the message.

protected buildAttachments(Message $message) : $this
Parameters
$message : Message
Return values
$this

buildFrom()

Add the sender to the message.

protected buildFrom(Message $message) : $this
Parameters
$message : Message
Return values
$this

buildMarkdownText()

Build the text view for a Markdown message.

protected buildMarkdownText(Markdown $markdown, array<string|int, mixed> $data) : string
Parameters
$markdown : Markdown
$data : array<string|int, mixed>
Return values
string

buildMarkdownView()

Build the Markdown view for the message.

protected buildMarkdownView() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildRecipients()

Add all of the recipients to the message.

protected buildRecipients(Message $message) : $this
Parameters
$message : Message
Return values
$this

buildSubject()

Set the subject for the message.

protected buildSubject(Message $message) : $this
Parameters
$message : Message
Return values
$this

buildView()

Build the view for the message.

protected buildView() : array<string|int, mixed>|string
Return values
array<string|int, mixed>|string

hasRecipient()

Determine if the given recipient is set on the mailable.

protected hasRecipient(object|array<string|int, mixed>|string $address[, string|null $name = null ][, string $property = 'to' ]) : bool
Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
$property : string = 'to'
Return values
bool

normalizeRecipient()

Convert the given recipient into an object.

protected normalizeRecipient(mixed $recipient) : object
Parameters
$recipient : mixed
Return values
object

runCallbacks()

Run the callbacks for the message.

protected runCallbacks(Message $message) : $this
Parameters
$message : Message
Return values
$this

setAddress()

Set the recipients of the message.

protected setAddress(object|array<string|int, mixed>|string $address[, string|null $name = null ][, string $property = 'to' ]) : $this

All recipients are stored internally as [['name' => ?, 'address' => ?]]

Parameters
$address : object|array<string|int, mixed>|string
$name : string|null = null
$property : string = 'to'
Return values
$this

Search results