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.
$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
send ( $mailer ) : void
Send the message using the given mailer.
Parameters
later ( $delay , Factory $queue ) : mixed
Deliver the queued message after the given delay.
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.
buildMarkdownText ( $markdown , $data ) : string
Build the text view for a Markdown message.
Parameters
- $markdown Markdown
- $data 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
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
subject ( $subject ) : $this
Set the subject of the message.
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
- $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
attachData ( $data , $name , array $options ) : $this
Attach in-memory data as an attachment.
Parameters
- $data string
- $name string
- $options array
assertSeeInHtml ( $string ) : $this
Assert that the given text is present in the HTML email body.
Parameters
- $string string
assertDontSeeInHtml ( $string ) : $this
Assert that the given text is not present in the HTML email body.
Parameters
- $string string
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
renderForAssertions ( ) : array
Render the HTML and plain-text version of the mailable into views for assertions.
mailer ( $mailer ) : $this
Set the name of the mailer that should send the message.
Parameters
- $mailer string
withSwiftMessage ( $callback ) : $this
Register a callback to be called with the Swift 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