Mailer
Mailer class for sending mail.
class Winter\Storm\Mail\Mailer
extends Illuminate\Mail\Mailer
Extends
Class | Description |
---|---|
Illuminate\Mail\Mailer
|
Traits
Trait | Description |
---|---|
Emitter
|
Adds event related features to any class. |
Properties
protected $pretendingOriginal : string
Original driver before pretending.
inherited
protected
$emitterEventCollection
:
array
= []
Collection of registered events.
inherited
protected
$emitterEventSorted
:
array
= []
Sorted collection of events.
inherited
protected
$emitterSingleEventCollection
:
array
= []
Collection of registered events to be fired once only.
Methods
public
later (int $delay, MailableContract | string | array $view, array $data = null
, Closure | string $callback = null
, string | null $queue = null
)
: mixed
Queue a new e-mail message for sending after (n) seconds.
Property | Type | Description |
---|---|---|
$delay | int |
int
|
$view | MailableContract | string | array |
MailableContract | string | array
|
$data | array |
array
|
$callback | Closure | string |
Closure | string
|
$queue | string | null |
string | null
|
public
laterOn (string $queue, int $delay, string | array $view, array $data = null
, Closure | string $callback = null
)
: mixed
Queue a new e-mail message for sending after (n) seconds on the given queue.
Property | Type | Description |
---|---|---|
$queue | string |
string
|
$delay | int |
int
|
$view | string | array |
string | array
|
$data | array |
array
|
$callback | Closure | string |
Closure | string
|
public
pretend (boolean $value = true
)
: void
Tell the mailer to not really send messages.
Property | Type | Description |
---|---|---|
$value | boolean |
boolean
|
public
queue (MailableContract | string | array $view, array $data = null
, Closure | string $callback = null
, string | null $queue = null
)
: mixed
Queue a new e-mail message for sending.
Property | Type | Description |
---|---|---|
$view | MailableContract | string | array |
MailableContract | string | array
|
$data | array |
array
|
$callback | Closure | string |
Closure | string
|
$queue | string | null |
string | null
|
public
queueOn (string $queue, string | array $view, array $data = null
, Closure | string $callback = null
)
: mixed
Queue a new e-mail message for sending on the given queue.
Property | Type | Description |
---|---|---|
$queue | string |
string
|
$view | string | array |
string | array
|
$data | array |
array
|
$callback | Closure | string |
Closure | string
|
public raw (string | array $view, mixed $callback) : Illuminate\Mail\SentMessage | null
Send a new message when only a raw text part.
Property | Type | Description |
---|---|---|
$view | string | array |
string | array
|
$callback | mixed |
mixed
|
public
rawTo (array $recipients, array | string $view, mixed $callback = null
, array $options = []
)
: Illuminate\Mail\SentMessage | null
Helper for raw() method, send a new message when only a raw text part.
Property | Type | Description |
---|---|---|
$recipients | array |
array
|
$view | array | string |
array | string
|
$callback | mixed |
mixed
|
$options | array |
array
|
public
send (Illuminate\Contracts\Mail\Mailable | string | array $view, array $data = []
, Closure | string | null $callback = null
)
: Illuminate\Mail\SentMessage | null
Send a new message using a view.
Overrides the Laravel defaults to provide the following functionality:
- Events (global & local):
- mailer.beforeSend
- mailer.prepareSend
- mailer.send
- Custom addContent() behavior
- Support for bypassing all addContent behavior when passing $view['raw' => true]
Property | Type | Description |
---|---|---|
$view | Illuminate\Contracts\Mail\Mailable | string | array |
Illuminate\Contracts\Mail\Mailable | string | array
|
$data | array |
array
|
$callback | Closure | string | null |
Closure | string | null
|
public
sendTo (array $recipients, string | array $view, array $data = []
, mixed $callback = null
, array $options = []
)
: mixed
Helper for send() method, the first argument can take a single email or an array of recipients where the key is the address and the value is the name.
Property | Type | Description |
---|---|---|
$recipients | array |
array
|
$view | string | array |
string | array
|
$data | array |
array
|
$callback | mixed |
mixed
|
$options | array |
array
|
protected
addContent (Illuminate\Mail\Message $message, string | null $view = null
, string | null $plain = null
, string | null $raw = null
, array | null $data = null
)
: void
Add the content to a given message.
Overrides the Laravel defaults to provide the following functionality:
- Events (global & local):
- mailer.beforeAddContent
- mailer.addContent
- Support for the Winter MailParser
Property | Type | Description |
---|---|---|
$message | Illuminate\Mail\Message |
Illuminate\Mail\Message
|
$view | string | null |
string | null
|
$plain | string | null |
string | null
|
$raw | string | null |
string | null
|
$data | array | null |
array | null
|
protected
addContentRaw (Illuminate\Mail\Message $message, string | null $html = null
, string | null $text = null
)
: void
Add the raw content to the provided message.
Property | Type | Description |
---|---|---|
$message | Illuminate\Mail\Message |
Illuminate\Mail\Message
|
$html | string | null |
string | null
|
$text | string | null |
string | null
|
protected
buildQueueMailable ($view, $data, mixed $callback, $queueName = null
)
: mixed
Build the mailable for a queued e-mail job.
Property | Type | Description |
---|---|---|
$view | mixed |
mixed
|
$data | mixed |
mixed
|
$callback | mixed |
mixed
|
$queueName | mixed |
mixed
|
protected processRecipients (mixed $recipients) : array
Process a recipients object, which can look like the following:
- (string) 'admin@domain.tld'
- (array) ['admin@domain.tld', 'other@domain.tld']
- (object) ['email' => 'admin@domain.tld', 'name' => 'Adam Person']
- (array) ['admin@domain.tld' => 'Adam Person', ...]
- (array) [ (object|array) ['email' => 'admin@domain.tld', 'name' => 'Adam Person'], [...] ]
Property | Type | Description |
---|---|---|
$recipients | mixed |
mixed
|
inherited
public
bindEvent (string | Closure | QueuedClosure $event, mixed $callback = null
, integer $priority)
: self
Create a new event binding.
Property | Type | Description |
---|---|---|
$event | string | Closure | QueuedClosure |
string | Closure | QueuedClosure
|
$callback | mixed |
mixed
when the third parameter is omitted and a Closure or QueuedClosure is provided this parameter is used as an integer this is used as priority variable |
$priority | integer |
integer
|
inherited
public
bindEventOnce (string | Closure | QueuedClosure $event, QueuedClosure | Closure | null $callback = null
)
: self
Create a new event binding that fires once only
Property | Type | Description |
---|---|---|
$event | string | Closure | QueuedClosure |
string | Closure | QueuedClosure
|
$callback | QueuedClosure | Closure | null |
QueuedClosure | Closure | null
When a Closure or QueuedClosure is provided as the first parameter this parameter can be omitted |
inherited
public
fireEvent (string $event, array $params = []
, boolean $halt = false
)
: array | mixed | null
Fire an event and call the listeners.
Property | Type | Description |
---|---|---|
$event | string |
string
Event name |
$params | array |
array
Event parameters |
$halt | boolean |
boolean
Halt after first non-null result |
If halted, the first non-null result. If not halted, an array of event results. Returns null if no listeners returned a result.
inherited
public
unbindEvent (string | array | object $event = null
)
: self
Destroys an event binding.
Property | Type | Description |
---|---|---|
$event | string | array | object |
string | array | object
Event to destroy |
inherited protected emitterEventSortEvents (string $eventName) : void
Sort the listeners for a given event by priority.
Property | Type | Description |
---|---|---|
$eventName | string |
string
|
inherited
protected
parseEventAndPayload (mixed $event, mixed $payload = null
)
: array
Parse the given event and payload and prepare them for dispatching.
Property | Type | Description |
---|---|---|
$event | mixed |
mixed
|
$payload | mixed |
mixed
|