class Mailable implements Mailable, Renderable

Traits

Properties

static protected array $macros

The registered string macros.

from  Macroable
string $locale

The locale of the message.

array $from

The person the message is from.

array $to

The "to" recipients of the message.

array $cc

The "cc" recipients of the message.

array $bcc

The "bcc" recipients of the message.

array $replyTo

The "reply to" recipients of the message.

string $subject

The subject of the message.

string $markdown

The Markdown template for the message (if applicable).

protected string $html

The HTML to use for the message.

string $view

The view to use for the message.

string $textView

The plain text view to use for the message.

array $viewData

The view data for the message.

array $attachments

The attachments for the message.

array $rawAttachments

The raw attachments for the message.

array $diskAttachments

The attachments from a storage disk.

protected array $tags

The tags for the message.

protected array $metadata

The metadata for the message.

array $callbacks

The callbacks for the message.

string|null $theme

The name of the theme that should be used when formatting the message.

string|null $mailer

The name of the mailer that should send the message.

protected array $assertionableRenderStrings

The rendered mailable views for testing / assertions.

static ?callable $viewDataCallback

The callback that should be invoked while building the view data.

Methods

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

mixed
forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

static never
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

mixed
withLocale(string|null $locale, Closure $callback)

Run the callback with the given locale.

mixed
getAttributeValue(object $target, string $attributeClass, string|null $property = null, mixed $default = null)

Get a configuration value from an attribute, falling back to a property.

mixed
extractAttributeValue(object $instance)

Extract the value from an attribute instance.

object|null
getAttributeInstance(object $target, string $attributeClass, ReflectionClass|null $declaringClass = null)

Get an instance of the given attribute class from the target class or its parents.

bool
propertyOverridesAttribute(object $target, ReflectionClass $reflection, string|null $property, ReflectionClass $attributeDeclaringClass)

Determine if a property declared on a child class overrides an inherited attribute.

mixed
tap(callable|null $callback = null)

Call the given Closure with this instance then return the instance.

from  Tappable
static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

__call(string $method, array $parameters)

Dynamically bind parameters to the message.

send(Factory|Mailer $mailer)

Send the message using the given mailer.

mixed
queue(Factory $queue)

Queue the message for sending.

mixed
later(DateInterval|DateTimeInterface|int $delay, Factory $queue)

Deliver the queued message after (n) seconds.

mixed
newQueuedJob()

Make the queued mailable job instance.

string
render()

Render the mailable into a view.

array|string
buildView()

Build the view for the message.

array
buildMarkdownView()

Build the Markdown view for the message.

array
buildViewData()

Build the view data for the message.

array
additionalMessageData()

Get additional meta-data to pass along with the view data.

buildMarkdownHtml(array $viewData)

Build the HTML view for a Markdown message.

buildMarkdownText(array $viewData)

Build the text view for a Markdown message.

string
markdownTheme()

Resolve the Markdown theme for this message.

buildFrom(Message $message)

Add the sender to the message.

buildRecipients(Message $message)

Add all of the recipients to the message.

buildSubject(Message $message)

Set the subject for the message.

buildAttachments(Message $message)

Add all of the attachments to the message.

void
buildDiskAttachments(Message $message)

Add all of the disk attachments to the message.

buildTags(Message $message)

Add all defined tags to the message.

buildMetadata(Message $message)

Add all defined metadata to the message.

runCallbacks(Message $message)

Run the callbacks for the message.

locale(string $locale)

Set the locale of the message.

priority(int $level = 3)

Set the priority of this message.

from(array|object|string $address, string|null $name = null)

Set the sender of the message.

bool
hasFrom(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

to(array|object|string $address, string|null $name = null)

Set the recipients of the message.

bool
hasTo(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

cc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

bool
hasCc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

bcc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

bool
hasBcc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

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

Set the "reply to" address of the message.

bool
hasReplyTo(array|object|string $address, string|null $name = null)

Determine if the given replyTo is set on the mailable.

setAddress(array|object|string $address, string|null $name = null, string $property = 'to')

Set the recipients of the message.

array
addressesToArray(array|object|string $address, string|null $name)

Convert the given recipient arguments to an array.

object
normalizeRecipient(mixed $recipient)

Convert the given recipient into an object.

bool
hasRecipient(array|object|string $address, string|null $name = null, string $property = 'to')

Determine if the given recipient is set on the mailable.

subject(string $subject)

Set the subject of the message.

bool
hasSubject(string $subject)

Determine if the mailable has the given subject.

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

Set the Markdown template for the message.

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

Set the view and view data for the message.

html(string $html)

Set the rendered HTML content for the message.

text(string $textView, array $data = [])

Set the plain text view for the message.

with(array|string $key, mixed $value = null)

Set the view data for the message.

attach(Attachable|Attachment|string $file, array $options = [])

Attach a file to the message.

attachMany(array $files)

Attach multiple files to the message.

bool
hasAttachment(Attachable|Attachment|string $file, array $options = [])

Determine if the mailable has the given attachment.

attachFromStorage(string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

attachFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

bool
hasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from storage.

bool
hasAttachmentFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from a specific storage disk.

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

Attach in-memory data as an attachment.

bool
hasAttachedData(string $data, string|null $name, array $options = [])

Determine if the mailable has the given data as an attachment.

tag(string $value)

Add a tag header to the message when supported by the underlying transport.

bool
hasTag(string $value)

Determine if the mailable has the given tag.

metadata(array|string $key, string|null $value = null)

Add a metadata header to the message when supported by the underlying transport.

bool
hasMetadata(string $key, int|string $value)

Determine if the mailable has the given metadata.

assertFrom(array|object|string $address, string|null $name = null)

Assert that the mailable is from the given address.

assertTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasCc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasBcc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasReplyTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given "reply to" address.

assertHasSubject(string $subject)

Assert that the mailable has the given subject.

assertSeeInHtml(string $string, bool $escape = true)

Assert that the given text is present in the HTML email body.

assertDontSeeInHtml(string $string, bool $escape = true)

Assert that the given text is not present in the HTML email body.

assertSeeInOrderInHtml(array $strings, bool $escape = true)

Assert that the given text strings are present in order in the HTML email body.

assertSeeInText(string $string)

Assert that the given text is present in the plain-text email body.

assertDontSeeInText(string $string)

Assert that the given text is not present in the plain-text email body.

assertSeeInOrderInText(array $strings)

Assert that the given text strings are present in order in the plain-text email body.

assertHasAttachment(Attachable|Attachment|string $file, array $options = [])

Assert the mailable has the given attachment.

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

Assert the mailable has the given data as an attachment.

assertHasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from storage.

assertHasAttachmentFromStorageDisk(string $disk, string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from a specific storage disk.

assertHasTag(string $tag)

Assert that the mailable has the given tag.

assertHasMetadata(string $key, string $value)

Assert that the mailable has the given metadata.

array
renderForAssertions()

Render the HTML and plain-text version of the mailable into views for assertions.

void
prepareMailableForDelivery()

Prepare the mailable instance for delivery.

bool
usesMailer(string $mailer)

Determine if the mailable will be sent by the given mailer.

mailer(string|null $mailer)

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

withSymfonyMessage(callable $callback)

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

static void
buildViewDataUsing(callable $callback)

Register a callback to be called while building the view data.

static void
flushState()

Flush all static state.

Details

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in ForwardsCalls at line 22
protected mixed forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 52
protected mixed forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 66
static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

in Localizable at line 15
mixed withLocale(string|null $locale, Closure $callback)

Run the callback with the given locale.

Parameters

string|null $locale
Closure $callback

Return Value

mixed

protected mixed getAttributeValue(object $target, string $attributeClass, string|null $property = null, mixed $default = null)

Get a configuration value from an attribute, falling back to a property.

Parameters

object $target
string $attributeClass
string|null $property
mixed $default

Return Value

mixed

protected mixed extractAttributeValue(object $instance)

Extract the value from an attribute instance.

Parameters

object $instance

Return Value

mixed

protected object|null getAttributeInstance(object $target, string $attributeClass, ReflectionClass|null $declaringClass = null)

Get an instance of the given attribute class from the target class or its parents.

Parameters

object $target
string $attributeClass
ReflectionClass|null $declaringClass

Return Value

object|null

protected bool propertyOverridesAttribute(object $target, ReflectionClass $reflection, string|null $property, ReflectionClass $attributeDeclaringClass)

Determine if a property declared on a child class overrides an inherited attribute.

Parameters

object $target
ReflectionClass $reflection
string|null $property
ReflectionClass $attributeDeclaringClass

Return Value

bool

in Tappable at line 15
mixed tap(callable|null $callback = null)

Call the given Closure with this instance then return the instance.

Parameters

callable|null $callback

Return Value

mixed

in Macroable at line 28
static void macro(string $name, callable|object $macro)

Register a custom macro.

Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.

Parameters

string $name
callable|object $macro

Return Value

void

in Macroable at line 41
static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 57
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

in Macroable at line 68
static void flushMacros()

Flush the existing macros.

Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.

Return Value

void

in Macroable at line 78
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

at line 1595
__call(string $method, array $parameters)

Dynamically bind parameters to the message.

Parameters

string $method
array $parameters

Exceptions

BadMethodCallException

at line 164
SentMessage|null send(Factory|Mailer $mailer)

Send the message using the given mailer.

Parameters

Factory|Mailer $mailer

Return Value

SentMessage|null

at line 188
mixed queue(Factory $queue)

Queue the message for sending.

Parameters

Factory $queue

Return Value

mixed

at line 217
mixed later(DateInterval|DateTimeInterface|int $delay, Factory $queue)

Deliver the queued message after (n) seconds.

Parameters

DateInterval|DateTimeInterface|int $delay
Factory $queue

Return Value

mixed

at line 245
protected mixed newQueuedJob()

Make the queued mailable job instance.

Return Value

mixed

at line 265
string render()

Render the mailable into a view.

Return Value

string

Exceptions

ReflectionException

at line 286
protected array|string buildView()

Build the view for the message.

Return Value

array|string

Exceptions

ReflectionException

at line 318
protected array buildMarkdownView()

Build the Markdown view for the message.

Return Value

array

Exceptions

ReflectionException

at line 333
array buildViewData()

Build the view data for the message.

Return Value

array

Exceptions

ReflectionException

at line 355
protected array additionalMessageData()

Get additional meta-data to pass along with the view data.

Return Value

array

at line 365
protected Closure buildMarkdownHtml(array $viewData)

Build the HTML view for a Markdown message.

Parameters

array $viewData

Return Value

Closure

at line 377
protected Closure buildMarkdownText(array $viewData)

Build the text view for a Markdown message.

Parameters

array $viewData

Return Value

Closure

at line 396
protected string markdownTheme()

Resolve the Markdown theme for this message.

Return Value

string

at line 407
protected Mailable buildFrom(Message $message)

Add the sender to the message.

Parameters

Message $message

Return Value

Mailable

at line 419
protected Mailable buildRecipients(Message $message)

Add all of the recipients to the message.

Parameters

Message $message

Return Value

Mailable

at line 433
protected Mailable buildSubject(Message $message)

Set the subject for the message.

Parameters

Message $message

Return Value

Mailable

at line 447
protected Mailable buildAttachments(Message $message)

Add all of the attachments to the message.

Parameters

Message $message

Return Value

Mailable

at line 469
protected void buildDiskAttachments(Message $message)

Add all of the disk attachments to the message.

Parameters

Message $message

Return Value

void

at line 488
protected Mailable buildTags(Message $message)

Add all defined tags to the message.

Parameters

Message $message

Return Value

Mailable

at line 502
protected Mailable buildMetadata(Message $message)

Add all defined metadata to the message.

Parameters

Message $message

Return Value

Mailable

at line 516
protected Mailable runCallbacks(Message $message)

Run the callbacks for the message.

Parameters

Message $message

Return Value

Mailable

at line 528
Mailable locale(string $locale)

Set the locale of the message.

Parameters

string $locale

Return Value

Mailable

at line 542
Mailable priority(int $level = 3)

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

Mailable

at line 554
Mailable from(array|object|string $address, string|null $name = null)

Set the sender of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 562
bool hasFrom(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 570
Mailable to(array|object|string $address, string|null $name = null)

Set the recipients of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 582
bool hasTo(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 590
Mailable cc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 598
bool hasCc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 606
Mailable bcc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 614
bool hasBcc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 622
Mailable replyTo(array|object|string $address, string|null $name = null)

Set the "reply to" address of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 630
bool hasReplyTo(array|object|string $address, string|null $name = null)

Determine if the given replyTo is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 640
protected Mailable setAddress(array|object|string $address, string|null $name = null, string $property = 'to')

Set the recipients of the message.

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

Parameters

array|object|string $address
string|null $name
string $property

Return Value

Mailable

at line 668
protected array addressesToArray(array|object|string $address, string|null $name)

Convert the given recipient arguments to an array.

Parameters

array|object|string $address
string|null $name

Return Value

array

at line 682
protected object normalizeRecipient(mixed $recipient)

Convert the given recipient into an object.

Parameters

mixed $recipient

Return Value

object

at line 711
protected bool hasRecipient(array|object|string $address, string|null $name = null, string $property = 'to')

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name
string $property

Return Value

bool

at line 758
Mailable subject(string $subject)

Set the subject of the message.

Parameters

string $subject

Return Value

Mailable

at line 768
bool hasSubject(string $subject)

Determine if the mailable has the given subject.

Parameters

string $subject

Return Value

bool

at line 777
Mailable markdown(string $view, array $data = [])

Set the Markdown template for the message.

Parameters

string $view
array $data

Return Value

Mailable

at line 788
Mailable view(string $view, array $data = [])

Set the view and view data for the message.

Parameters

string $view
array $data

Return Value

Mailable

at line 799
Mailable html(string $html)

Set the rendered HTML content for the message.

Parameters

string $html

Return Value

Mailable

at line 809
Mailable text(string $textView, array $data = [])

Set the plain text view for the message.

Parameters

string $textView
array $data

Return Value

Mailable

at line 820
Mailable with(array|string $key, mixed $value = null)

Set the view data for the message.

Parameters

array|string $key
mixed $value

Return Value

Mailable

at line 834
Mailable attach(Attachable|Attachment|string $file, array $options = [])

Attach a file to the message.

Parameters

Attachable|Attachment|string $file
array $options

Return Value

Mailable

at line 855
Mailable attachMany(array $files)

Attach multiple files to the message.

Parameters

array $files

Return Value

Mailable

at line 871
bool hasAttachment(Attachable|Attachment|string $file, array $options = [])

Determine if the mailable has the given attachment.

Parameters

Attachable|Attachment|string $file
array $options

Return Value

bool

at line 924
Mailable attachFromStorage(string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

Parameters

string $path
string|null $name
array $options

Return Value

Mailable

at line 932
Mailable attachFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

Parameters

string|null $disk
string $path
string|null $name
array $options

Return Value

Mailable

at line 949
bool hasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from storage.

Parameters

string $path
string|null $name
array $options

Return Value

bool

at line 957
bool hasAttachmentFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from a specific storage disk.

Parameters

string|null $disk
string $path
string|null $name
array $options

Return Value

bool

at line 970
Mailable attachData(string $data, string $name, array $options = [])

Attach in-memory data as an attachment.

Parameters

string $data
string $name
array $options

Return Value

Mailable

at line 984
bool hasAttachedData(string $data, string|null $name, array $options = [])

Determine if the mailable has the given data as an attachment.

Parameters

string $data
string|null $name
array $options

Return Value

bool

at line 996
Mailable tag(string $value)

Add a tag header to the message when supported by the underlying transport.

Parameters

string $value

Return Value

Mailable

at line 1006
bool hasTag(string $value)

Determine if the mailable has the given tag.

Parameters

string $value

Return Value

bool

at line 1015
Mailable metadata(array|string $key, string|null $value = null)

Add a metadata header to the message when supported by the underlying transport.

Parameters

array|string $key
string|null $value

Return Value

Mailable

at line 1029
bool hasMetadata(string $key, int|string $value)

Determine if the mailable has the given metadata.

Parameters

string $key
int|string $value

Return Value

bool

at line 1038
Mailable assertFrom(array|object|string $address, string|null $name = null)

Assert that the mailable is from the given address.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1056
Mailable assertTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1074
Mailable assertHasTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1082
Mailable assertHasCc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1100
Mailable assertHasBcc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1118
Mailable assertHasReplyTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given "reply to" address.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1171
Mailable assertHasSubject(string $subject)

Assert that the mailable has the given subject.

Parameters

string $subject

Return Value

Mailable

at line 1186
Mailable assertSeeInHtml(string $string, bool $escape = true)

Assert that the given text is present in the HTML email body.

Parameters

string $string
bool $escape

Return Value

Mailable

at line 1204
Mailable assertDontSeeInHtml(string $string, bool $escape = true)

Assert that the given text is not present in the HTML email body.

Parameters

string $string
bool $escape

Return Value

Mailable

at line 1222
Mailable assertSeeInOrderInHtml(array $strings, bool $escape = true)

Assert that the given text strings are present in order in the HTML email body.

Parameters

array $strings
bool $escape

Return Value

Mailable

at line 1238
Mailable assertSeeInText(string $string)

Assert that the given text is present in the plain-text email body.

Parameters

string $string

Return Value

Mailable

at line 1254
Mailable assertDontSeeInText(string $string)

Assert that the given text is not present in the plain-text email body.

Parameters

string $string

Return Value

Mailable

at line 1270
Mailable assertSeeInOrderInText(array $strings)

Assert that the given text strings are present in order in the plain-text email body.

Parameters

array $strings

Return Value

Mailable

at line 1282
Mailable assertHasAttachment(Attachable|Attachment|string $file, array $options = [])

Assert the mailable has the given attachment.

Parameters

Attachable|Attachment|string $file
array $options

Return Value

Mailable

at line 1297
Mailable assertHasAttachedData(string $data, string $name, array $options = [])

Assert the mailable has the given data as an attachment.

Parameters

string $data
string $name
array $options

Return Value

Mailable

at line 1312
Mailable assertHasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from storage.

Parameters

string $path
string|null $name
array $options

Return Value

Mailable

at line 1327
Mailable assertHasAttachmentFromStorageDisk(string $disk, string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from a specific storage disk.

Parameters

string $disk
string $path
string|null $name
array $options

Return Value

Mailable

at line 1342
Mailable assertHasTag(string $tag)

Assert that the mailable has the given tag.

Parameters

string $tag

Return Value

Mailable

at line 1357
Mailable assertHasMetadata(string $key, string $value)

Assert that the mailable has the given metadata.

Parameters

string $key
string $value

Return Value

Mailable

at line 1374
protected array renderForAssertions()

Render the HTML and plain-text version of the mailable into views for assertions.

Return Value

array

Exceptions

ReflectionException

at line 1412
protected void prepareMailableForDelivery()

Prepare the mailable instance for delivery.

Return Value

void

at line 1545
bool usesMailer(string $mailer)

Determine if the mailable will be sent by the given mailer.

Parameters

string $mailer

Return Value

bool

at line 1553
Mailable mailer(string|null $mailer)

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

Parameters

string|null $mailer

Return Value

Mailable

at line 1563
Mailable withSymfonyMessage(callable $callback)

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

Parameters

callable $callback

Return Value

Mailable

at line 1576
static void buildViewDataUsing(callable $callback)

Register a callback to be called while building the view data.

Boot-only. The callback persists in a static property for the worker lifetime and runs on every Mailable render across all coroutines.

Parameters

callable $callback

Return Value

void

at line 1584
static void flushState()

Flush all static state.

Return Value

void