Mailable
Implements
Uses
Properties
$locale string
The locale of the message.
$from array
The person the message is from.
$to array
The "to" recipients of the message.
$cc array
The "cc" recipients of the message.
$bcc array
The "bcc" recipients of the message.
$replyTo array
The "reply to" recipients of the message.
$subject string
The subject of the message.
$markdown string
The Markdown template for the message (if applicable).
$html string
The HTML to use for the message.
$view string
The view to use for the message.
$textView string
The plain text view to use for the message.
$viewData array
The view data for the message.
$attachments array
The attachments for the message.
$rawAttachments array
The raw attachments for the message.
$diskAttachments array
The attachments from a storage disk.
$tags array
The tags for the message.
$metadata array
The metadata for the message.
$callbacks array
The callbacks for the message.
$theme string|null
The name of the theme that should be used when formatting the message.
$mailer string
The name of the mailer that should send the message.
$assertionableRenderStrings array
The rendered mailable views for testing / assertions.
$viewDataCallback callable
The callback that should be invoked while building the view data.
Methods
later ( $delay , Factory $queue ) : mixed
Deliver the queued message after (n) seconds.
Parameters
- $delay DateTimeInterface |DateInterval |int
- $queue Factory
newQueuedJob ( ) : mixed
Make the queued mailable job instance.
render ( ) : string
Render the mailable into a view.
buildView ( ) : array|string
Build the view for the message.
buildMarkdownView ( ) : array
Build the Markdown view for the message.
buildViewData ( ) : array
Build the view data for the message.
buildMarkdownHtml ( $viewData ) : Closure
Build the HTML view for a Markdown message.
Parameters
- $viewData array
buildMarkdownText ( $viewData ) : Closure
Build the text view for a Markdown message.
Parameters
- $viewData array
buildRecipients ( $message ) : $this
Add all of the recipients to the message.
Parameters
- $message Message
buildSubject ( $message ) : $this
Set the subject for the message.
Parameters
- $message Message
buildAttachments ( $message ) : $this
Add all of the attachments to the message.
Parameters
- $message Message
buildDiskAttachments ( $message ) : void
Add all of the disk attachments to the message.
Parameters
- $message Message
buildTags ( $message ) : $this
Add all defined tags to the message.
Parameters
- $message Message
buildMetadata ( $message ) : $this
Add all defined metadata to the message.
Parameters
- $message Message
runCallbacks ( $message ) : $this
Run the callbacks for the message.
Parameters
- $message Message
locale ( $locale ) : $this
Set the locale of the message.
Parameters
- $locale string
priority ( $level ) : $this
Set the priority of this message.
Parameters
- $level int
from ( $address , $name ) : $this
Set the sender of the message.
Parameters
- $address object|array|string
- $name string|null
hasFrom ( $address , $name ) : bool
Determine if the given recipient is set on the mailable.
Parameters
- $address object|array|string
- $name string|null
to ( $address , $name ) : $this
Set the recipients of the message.
Parameters
- $address object|array|string
- $name string|null
hasTo ( $address , $name ) : bool
Determine if the given recipient is set on the mailable.
Parameters
- $address object|array|string
- $name string|null
cc ( $address , $name ) : $this
Set the recipients of the message.
Parameters
- $address object|array|string
- $name string|null
hasCc ( $address , $name ) : bool
Determine if the given recipient is set on the mailable.
Parameters
- $address object|array|string
- $name string|null
bcc ( $address , $name ) : $this
Set the recipients of the message.
Parameters
- $address object|array|string
- $name string|null
hasBcc ( $address , $name ) : bool
Determine if the given recipient is set on the mailable.
Parameters
- $address object|array|string
- $name string|null
replyTo ( $address , $name ) : $this
Set the "reply to" address of the message.
Parameters
- $address object|array|string
- $name string|null
hasReplyTo ( $address , $name ) : bool
Determine if the given replyTo is set on the mailable.
Parameters
- $address object|array|string
- $name string|null
setAddress ( $address , $name , $property ) : $this
Set the recipients of the message.
Parameters
- $address object|array|string
- $name string|null
- $property string
addressesToArray ( $address , $name ) : array
Convert the given recipient arguments to an array.
Parameters
- $address object|array|string
- $name string|null
normalizeRecipient ( $recipient ) : object
Convert the given recipient into an object.
Parameters
- $recipient mixed
hasRecipient ( $address , $name , $property ) : bool
Determine if the given recipient is set on the mailable.
Parameters
- $address object|array|string
- $name string|null
- $property string
hasEnvelopeRecipient ( $address , $name , $property ) : bool
Determine if the mailable "envelope" method defines a recipient.
Parameters
- $address string
- $name string|null
- $property string
subject ( $subject ) : $this
Set the subject of the message.
Parameters
- $subject string
hasSubject ( $subject ) : bool
Determine if the mailable has the given subject.
Parameters
- $subject string
markdown ( $view , array $data ) : $this
Set the Markdown template for the message.
Parameters
- $view string
- $data array
view ( $view , array $data ) : $this
Set the view and view data for the message.
Parameters
- $view string
- $data array
html ( $html ) : $this
Set the rendered HTML content for the message.
Parameters
- $html string
text ( $textView , array $data ) : $this
Set the plain text view for the message.
Parameters
- $textView string
- $data array
with ( $key , $value ) : $this
Set the view data for the message.
Parameters
- $key string|array
- $value mixed
attach ( $file , array $options ) : $this
Attach a file to the message.
Parameters
- $file string|Attachable |Attachment
- $options array
attachMany ( $files ) : $this
Attach multiple files to the message.
Parameters
- $files array
hasAttachment ( $file , array $options ) : bool
Determine if the mailable has the given attachment.
Parameters
- $file string|Attachable |Attachment
- $options array
hasEnvelopeAttachment ( $attachment , $options ) : bool
Determine if the mailable has the given envelope attachment.
Parameters
- $attachment Attachment
- $options array
attachFromStorage ( $path , $name , array $options ) : $this
Attach a file to the message from storage.
Parameters
- $path string
- $name string|null
- $options array
attachFromStorageDisk ( $disk , $path , $name , array $options ) : $this
Attach a file to the message from storage.
Parameters
- $disk string
- $path string
- $name string|null
- $options array
hasAttachmentFromStorage ( $path , $name , array $options ) : bool
Determine if the mailable has the given attachment from storage.
Parameters
- $path string
- $name string|null
- $options array
hasAttachmentFromStorageDisk ( $disk , $path , $name , array $options ) : bool
Determine if the mailable has the given attachment from a specific storage disk.
Parameters
- $disk string
- $path string
- $name string|null
- $options array
attachData ( $data , $name , array $options ) : $this
Attach in-memory data as an attachment.
Parameters
- $data string
- $name string
- $options array
hasAttachedData ( $data , $name , array $options ) : bool
Determine if the mailable has the given data as an attachment.
Parameters
- $data string
- $name string
- $options array
tag ( $value ) : $this
Add a tag header to the message when supported by the underlying transport.
Parameters
- $value string
hasTag ( $value ) : bool
Determine if the mailable has the given tag.
Parameters
- $value string
metadata ( $key , $value ) : $this
Add a metadata header to the message when supported by the underlying transport.
Parameters
- $key string
- $value string
hasMetadata ( $key , $value ) : bool
Determine if the mailable has the given metadata.
Parameters
- $key string
- $value string
assertFrom ( $address , $name ) : $this
Assert that the mailable is from the given address.
Parameters
- $address object|array|string
- $name string|null
assertTo ( $address , $name ) : $this
Assert that the mailable has the given recipient.
Parameters
- $address object|array|string
- $name string|null
assertHasTo ( $address , $name ) : $this
Assert that the mailable has the given recipient.
Parameters
- $address object|array|string
- $name string|null
assertHasCc ( $address , $name ) : $this
Assert that the mailable has the given recipient.
Parameters
- $address object|array|string
- $name string|null
assertHasBcc ( $address , $name ) : $this
Assert that the mailable has the given recipient.
Parameters
- $address object|array|string
- $name string|null
assertHasReplyTo ( $address , $name ) : $this
Assert that the mailable has the given "reply to" address.
Parameters
- $address object|array|string
- $name string|null
formatAssertionRecipient ( $address , $name ) : string
Format the mailable recipient for display in an assertion message.
Parameters
- $address object|array|string
- $name string|null
assertHasSubject ( $subject ) : $this
Assert that the mailable has the given subject.
Parameters
- $subject string
assertSeeInHtml ( $string , $escape ) : $this
Assert that the given text is present in the HTML email body.
Parameters
- $string string
- $escape bool
assertDontSeeInHtml ( $string , $escape ) : $this
Assert that the given text is not present in the HTML email body.
Parameters
- $string string
- $escape bool
assertSeeInOrderInHtml ( $strings , $escape ) : $this
Assert that the given text strings are present in order in the HTML email body.
Parameters
- $strings array
- $escape bool
assertSeeInText ( $string ) : $this
Assert that the given text is present in the plain-text email body.
Parameters
- $string string
assertDontSeeInText ( $string ) : $this
Assert that the given text is not present in the plain-text email body.
Parameters
- $string string
assertSeeInOrderInText ( $strings ) : $this
Assert that the given text strings are present in order in the plain-text email body.
Parameters
- $strings array
assertHasAttachment ( $file , array $options ) : $this
Assert the mailable has the given attachment.
Parameters
- $file string|Attachable |Attachment
- $options array
assertHasAttachedData ( $data , $name , array $options ) : $this
Assert the mailable has the given data as an attachment.
Parameters
- $data string
- $name string
- $options array
assertHasAttachmentFromStorage ( $path , $name , array $options ) : $this
Assert the mailable has the given attachment from storage.
Parameters
- $path string
- $name string|null
- $options array
assertHasAttachmentFromStorageDisk ( $disk , $path , $name , array $options ) : $this
Assert the mailable has the given attachment from a specific storage disk.
Parameters
- $disk string
- $path string
- $name string|null
- $options array
assertHasTag ( $tag ) : $this
Assert that the mailable has the given tag.
Parameters
- $tag string
assertHasMetadata ( $key , $value ) : $this
Assert that the mailable has the given metadata.
Parameters
- $key string
- $value string
renderForAssertions ( ) : array
Render the HTML and plain-text version of the mailable into views for assertions.
prepareMailableForDelivery ( ) : void
Prepare the mailable instance for delivery.
ensureHeadersAreHydrated ( ) : void
Ensure the mailable's headers are hydrated from the "headers" method.
ensureEnvelopeIsHydrated ( ) : void
Ensure the mailable's "envelope" data is hydrated from the "envelope" method.
ensureContentIsHydrated ( ) : void
Ensure the mailable's content is hydrated from the "content" method.
ensureAttachmentsAreHydrated ( ) : void
Ensure the mailable's attachments are hydrated from the "attachments" method.
mailer ( $mailer ) : $this
Set the name of the mailer that should send the message.
Parameters
- $mailer string
withSymfonyMessage ( $callback ) : $this
Register a callback to be called with the Symfony message instance.
Parameters
- $callback callable
buildViewDataUsing ( callable $callback ) : void
Register a callback to be called while building the view data.
Parameters
- $callback callable
__call ( $method , $parameters ) : $this
Dynamically bind parameters to the message.
Parameters
- $method string
- $parameters array