Mailer
in package
implements
Mailer, MailQueue
Uses
Macroable
Interfaces, Classes and Traits
Table of Contents
- $events : Dispatcher|null
- The event dispatcher instance.
- $failedRecipients : array<string|int, mixed>
- Array of failed recipients.
- $from : array<string|int, mixed>
- The global from address and name.
- $macros : array<string|int, mixed>
- The registered string macros.
- $queue : Queue
- The queue implementation.
- $replyTo : array<string|int, mixed>
- The global reply-to address and name.
- $swift : Swift_Mailer
- The Swift Mailer instance.
- $to : array<string|int, mixed>
- The global to address and name.
- $views : Factory
- The view factory instance.
- __call() : mixed
- Dynamically handle calls to the class.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __construct() : void
- Create a new Mailer instance.
- alwaysFrom() : void
- Set the global from address and name.
- alwaysReplyTo() : void
- Set the global reply-to address and name.
- alwaysTo() : void
- Set the global to address and name.
- bcc() : PendingMail
- Begin the process of mailing a mailable class instance.
- failures() : array<string|int, mixed>
- Get the array of failed recipients.
- getSwiftMailer() : Swift_Mailer
- Get the Swift Mailer instance.
- getViewFactory() : Factory
- Get the view factory instance.
- hasMacro() : bool
- Checks if macro is registered.
- later() : mixed
- Queue a new e-mail message for sending after (n) seconds.
- laterOn() : mixed
- Queue a new e-mail message for sending after (n) seconds on the given queue.
- macro() : void
- Register a custom macro.
- mixin() : void
- Mix another object into the class.
- onQueue() : mixed
- Queue a new e-mail message for sending on the given queue.
- plain() : void
- Send a new message when only a plain part.
- queue() : mixed
- Queue a new e-mail message for sending.
- queueOn() : mixed
- Queue a new e-mail message for sending on the given queue.
- raw() : void
- Send a new message when only a raw text part.
- render() : string
- Render the given message as a view.
- send() : void
- Send a new message using a view.
- setQueue() : $this
- Set the queue manager instance.
- setSwiftMailer() : void
- Set the Swift Mailer instance.
- to() : PendingMail
- Begin the process of mailing a mailable class instance.
- addContent() : void
- Add the content to a given message.
- createMessage() : Message
- Create a new message instance.
- dispatchSentEvent() : void
- Dispatch the message sent event.
- forceReconnection() : void
- Force the transport to re-connect.
- parseView() : array<string|int, mixed>
- Parse the given view name or array.
- renderView() : string
- Render the given view.
- sendMailable() : mixed
- Send the given mailable.
- sendSwiftMessage() : void
- Send a Swift Message instance.
- setGlobalTo() : void
- Set the global "to" address on the given message.
- shouldSendMessage() : bool
- Determines if the message can be sent.
Properties
$events
The event dispatcher instance.
protected
Dispatcher|null
$events
$failedRecipients
Array of failed recipients.
protected
array<string|int, mixed>
$failedRecipients
= []
$from
The global from address and name.
protected
array<string|int, mixed>
$from
$macros
The registered string macros.
protected
static array<string|int, mixed>
$macros
= []
$queue
The queue implementation.
protected
Queue
$queue
$replyTo
The global reply-to address and name.
protected
array<string|int, mixed>
$replyTo
$swift
The Swift Mailer instance.
protected
Swift_Mailer
$swift
$to
The global to address and name.
protected
array<string|int, mixed>
$to
$views
The view factory instance.
protected
Factory
$views
Methods
__call()
Dynamically handle calls to the class.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__callStatic()
Dynamically handle calls to the class.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__construct()
Create a new Mailer instance.
public
__construct(Factory $views, Swift_Mailer $swift[, Dispatcher|null $events = null ]) : void
Parameters
- $views : Factory
- $swift : Swift_Mailer
- $events : Dispatcher|null = null
Return values
void —alwaysFrom()
Set the global from address and name.
public
alwaysFrom(string $address[, string|null $name = null ]) : void
Parameters
- $address : string
- $name : string|null = null
Return values
void —alwaysReplyTo()
Set the global reply-to address and name.
public
alwaysReplyTo(string $address[, string|null $name = null ]) : void
Parameters
- $address : string
- $name : string|null = null
Return values
void —alwaysTo()
Set the global to address and name.
public
alwaysTo(string $address[, string|null $name = null ]) : void
Parameters
- $address : string
- $name : string|null = null
Return values
void —bcc()
Begin the process of mailing a mailable class instance.
public
bcc(mixed $users) : PendingMail
Parameters
- $users : mixed
Return values
PendingMail —failures()
Get the array of failed recipients.
public
failures() : array<string|int, mixed>
Return values
array<string|int, mixed> —getSwiftMailer()
Get the Swift Mailer instance.
public
getSwiftMailer() : Swift_Mailer
Return values
Swift_Mailer —getViewFactory()
Get the view factory instance.
public
getViewFactory() : Factory
Return values
Factory —hasMacro()
Checks if macro is registered.
public
static hasMacro(string $name) : bool
Parameters
- $name : string
Return values
bool —later()
Queue a new e-mail message for sending after (n) seconds.
public
later(DateTimeInterface|DateInterval|int $delay, string|array<string|int, mixed>|Mailable $view[, string|null $queue = null ]) : mixed
Parameters
- $delay : DateTimeInterface|DateInterval|int
- $view : string|array<string|int, mixed>|Mailable
- $queue : string|null = null
Return values
mixed —laterOn()
Queue a new e-mail message for sending after (n) seconds on the given queue.
public
laterOn(string $queue, DateTimeInterface|DateInterval|int $delay, string|array<string|int, mixed> $view) : mixed
Parameters
- $queue : string
- $delay : DateTimeInterface|DateInterval|int
- $view : string|array<string|int, mixed>
Return values
mixed —macro()
Register a custom macro.
public
static macro(string $name, object|callable $macro) : void
Parameters
- $name : string
- $macro : object|callable
Return values
void —mixin()
Mix another object into the class.
public
static mixin(object $mixin) : void
Parameters
- $mixin : object
Return values
void —onQueue()
Queue a new e-mail message for sending on the given queue.
public
onQueue(string $queue, string|array<string|int, mixed> $view) : mixed
Parameters
- $queue : string
- $view : string|array<string|int, mixed>
Return values
mixed —plain()
Send a new message when only a plain part.
public
plain(string $view, array<string|int, mixed> $data, mixed $callback) : void
Parameters
- $view : string
- $data : array<string|int, mixed>
- $callback : mixed
Return values
void —queue()
Queue a new e-mail message for sending.
public
queue(string|array<string|int, mixed>|Mailable $view[, string|null $queue = null ]) : mixed
Parameters
- $view : string|array<string|int, mixed>|Mailable
- $queue : string|null = null
Return values
mixed —queueOn()
Queue a new e-mail message for sending on the given queue.
public
queueOn(string $queue, string|array<string|int, mixed> $view) : mixed
This method didn't match rest of framework's "onQueue" phrasing. Added "onQueue".
Parameters
- $queue : string
- $view : string|array<string|int, mixed>
Return values
mixed —raw()
Send a new message when only a raw text part.
public
raw(string $text, mixed $callback) : void
Parameters
- $text : string
- $callback : mixed
Return values
void —render()
Render the given message as a view.
public
render(string|array<string|int, mixed> $view[, array<string|int, mixed> $data = [] ]) : string
Parameters
- $view : string|array<string|int, mixed>
- $data : array<string|int, mixed> = []
Return values
string —send()
Send a new message using a view.
public
send(string|array<string|int, mixed>|Mailable $view[, array<string|int, mixed> $data = [] ][, Closure|string $callback = null ]) : void
Parameters
- $view : string|array<string|int, mixed>|Mailable
- $data : array<string|int, mixed> = []
- $callback : Closure|string = null
Return values
void —setQueue()
Set the queue manager instance.
public
setQueue(Factory $queue) : $this
Parameters
- $queue : Factory
Return values
$this —setSwiftMailer()
Set the Swift Mailer instance.
public
setSwiftMailer(Swift_Mailer $swift) : void
Parameters
- $swift : Swift_Mailer
Return values
void —to()
Begin the process of mailing a mailable class instance.
public
to(mixed $users) : PendingMail
Parameters
- $users : mixed
Return values
PendingMail —addContent()
Add the content to a given message.
protected
addContent(Message $message, string $view, string $plain, string $raw, array<string|int, mixed> $data) : void
Parameters
- $message : Message
- $view : string
- $plain : string
- $raw : string
- $data : array<string|int, mixed>
Return values
void —createMessage()
Create a new message instance.
protected
createMessage() : Message
Return values
Message —dispatchSentEvent()
Dispatch the message sent event.
protected
dispatchSentEvent(Message $message) : void
Parameters
- $message : Message
Return values
void —forceReconnection()
Force the transport to re-connect.
protected
forceReconnection() : void
This will prevent errors in daemon queue situations.
Return values
void —parseView()
Parse the given view name or array.
protected
parseView(string|array<string|int, mixed> $view) : array<string|int, mixed>
Parameters
- $view : string|array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —renderView()
Render the given view.
protected
renderView(string $view, array<string|int, mixed> $data) : string
Parameters
- $view : string
- $data : array<string|int, mixed>
Return values
string —sendMailable()
Send the given mailable.
protected
sendMailable(Mailable $mailable) : mixed
Parameters
- $mailable : Mailable
Return values
mixed —sendSwiftMessage()
Send a Swift Message instance.
protected
sendSwiftMessage(Swift_Message $message) : void
Parameters
- $message : Swift_Message
Return values
void —setGlobalTo()
Set the global "to" address on the given message.
protected
setGlobalTo(Message $message) : void
Parameters
- $message : Message
Return values
void —shouldSendMessage()
Determines if the message can be sent.
protected
shouldSendMessage(Swift_Message $message) : bool
Parameters
- $message : Swift_Message