class Illuminate / Mail / Mailable
You are viewing an older version of the documentation. For the latest, please visit master documentation.

Mailable

Implements

Uses

Properties

public

$locale string

The locale of the message.

Default: null
public

$from array

The person the message is from.

Default: []
public

$to array

The "to" recipients of the message.

Default: []
public

$cc array

The "cc" recipients of the message.

Default: []
public

$bcc array

The "bcc" recipients of the message.

Default: []
public

$replyTo array

The "reply to" recipients of the message.

Default: []
public

$subject string

The subject of the message.

Default: null
public

$markdown string

The Markdown template for the message (if applicable).

Default: null
protected

$html string

The HTML to use for the message.

Default: null
public

$view string

The view to use for the message.

Default: null
public

$textView string

The plain text view to use for the message.

Default: null
public

$viewData array

The view data for the message.

Default: []
public

$attachments array

The attachments for the message.

Default: []
public

$rawAttachments array

The raw attachments for the message.

Default: []
public

$diskAttachments array

The attachments from a storage disk.

Default: []
public

$callbacks array

The callbacks for the message.

Default: []
public

$theme string|null

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

Default: null
public

$mailer string

The name of the mailer that should send the message.

Default: null
protected

$assertionableRenderStrings array

The rendered mailable views for testing / assertions.

Default: null
public static

$viewDataCallback callable

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

Default: null

Methods

public

send ( $mailer ) : void

Send the message using the given mailer.

Parameters

public

queue ( Factory $queue ) : mixed

Queue the message for sending.

Parameters

public

later ( $delay , Factory $queue ) : mixed

Deliver the queued message after the given delay.

Parameters

protected

newQueuedJob ( ) : mixed

Make the queued mailable job instance.

public

render ( ) : string

Render the mailable into a view.

protected

buildView ( ) : array|string

Build the view for the message.

protected

buildMarkdownView ( ) : array

Build the Markdown view for the message.

public

buildViewData ( ) : array

Build the view data for the message.

protected

buildMarkdownText ( $markdown , $data ) : string

Build the text view for a Markdown message.

Parameters

protected

buildFrom ( $message ) : $this

Add the sender to the message.

Parameters

protected

buildRecipients ( $message ) : $this

Add all of the recipients to the message.

Parameters

protected

buildSubject ( $message ) : $this

Set the subject for the message.

Parameters

protected

buildAttachments ( $message ) : $this

Add all of the attachments to the message.

Parameters

protected

buildDiskAttachments ( $message ) : void

Add all of the disk attachments to the message.

Parameters

protected

runCallbacks ( $message ) : $this

Run the callbacks for the message.

Parameters

public

locale ( $locale ) : $this

Set the locale of the message.

Parameters

  • $locale string
public

priority ( $level ) : $this

Set the priority of this message.

Parameters

  • $level int
public

from ( $address , $name ) : $this

Set the sender of the message.

Parameters

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

hasFrom ( $address , $name ) : bool

Determine if the given recipient is set on the mailable.

Parameters

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

to ( $address , $name ) : $this

Set the recipients of the message.

Parameters

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

hasTo ( $address , $name ) : bool

Determine if the given recipient is set on the mailable.

Parameters

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

cc ( $address , $name ) : $this

Set the recipients of the message.

Parameters

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

hasCc ( $address , $name ) : bool

Determine if the given recipient is set on the mailable.

Parameters

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

bcc ( $address , $name ) : $this

Set the recipients of the message.

Parameters

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

hasBcc ( $address , $name ) : bool

Determine if the given recipient is set on the mailable.

Parameters

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

replyTo ( $address , $name ) : $this

Set the "reply to" address of the message.

Parameters

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

hasReplyTo ( $address , $name ) : bool

Determine if the given replyTo is set on the mailable.

Parameters

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

setAddress ( $address , $name , $property ) : $this

Set the recipients of the message.

Parameters

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

addressesToArray ( $address , $name ) : array

Convert the given recipient arguments to an array.

Parameters

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

normalizeRecipient ( $recipient ) : object

Convert the given recipient into an object.

Parameters

  • $recipient mixed
protected

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
public

subject ( $subject ) : $this

Set the subject of the message.

Parameters

  • $subject string
public

markdown ( $view , array $data ) : $this

Set the Markdown template for the message.

Parameters

  • $view string
  • $data array
public

view ( $view , array $data ) : $this

Set the view and view data for the message.

Parameters

  • $view string
  • $data array
public

html ( $html ) : $this

Set the rendered HTML content for the message.

Parameters

  • $html string
public

text ( $textView , array $data ) : $this

Set the plain text view for the message.

Parameters

  • $textView string
  • $data array
public

with ( $key , $value ) : $this

Set the view data for the message.

Parameters

  • $key string|array
  • $value mixed
public

attach ( $file , array $options ) : $this

Attach a file to the message.

Parameters

  • $file string
  • $options array
public

attachFromStorage ( $path , $name , array $options ) : $this

Attach a file to the message from storage.

Parameters

  • $path string
  • $name string|null
  • $options array
public

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
public

attachData ( $data , $name , array $options ) : $this

Attach in-memory data as an attachment.

Parameters

  • $data string
  • $name string
  • $options array
public

assertSeeInHtml ( $string ) : $this

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

Parameters

  • $string string
public

assertDontSeeInHtml ( $string ) : $this

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

Parameters

  • $string string
public

assertSeeInText ( $string ) : $this

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

Parameters

  • $string string
public

assertDontSeeInText ( $string ) : $this

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

Parameters

  • $string string
protected

renderForAssertions ( ) : array

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

public

mailer ( $mailer ) : $this

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

Parameters

  • $mailer string
public

withSwiftMessage ( $callback ) : $this

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

Parameters

  • $callback callable
public static

buildViewDataUsing ( callable $callback ) : void

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

Parameters

  • $callback callable
public

__call ( $method , $parameters ) : $this

Dynamically bind parameters to the message.

Parameters

  • $method string
  • $parameters array