Mailer
class Mailer implements Mailer, MailQueue
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
protected Factory | $views | The view factory instance. |
|
protected Swift_Mailer | $swift | The Swift Mailer instance. |
|
protected Dispatcher|null | $events | The event dispatcher instance. |
|
protected array | $from | The global from address and name. |
|
protected array | $replyTo | The global reply-to address and name. |
|
protected array | $to | The global to address and name. |
|
protected Queue | $queue | The queue implementation. |
|
protected array | $failedRecipients | Array of failed recipients. |
Methods
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new Mailer instance.
Set the global from address and name.
Set the global reply-to address and name.
Set the global to address and name.
Begin the process of mailing a mailable class instance.
Begin the process of mailing a mailable class instance.
Send a new message when only a plain part.
Parse the given view name or array.
Add the content to a given message.
Render the given view.
Create a new message instance.
Send a Swift Message instance.
Determines if the message can be sent.
Force the transport to re-connect.
Get the view factory instance.
Get the Swift Mailer instance.
Get the array of failed recipients.
Set the Swift Mailer instance.
Details
in
Macroable at line 24
static void
macro(string $name, callable $macro)
Register a custom macro.
in
Macroable at line 35
static bool
hasMacro(string $name)
Checks if macro is registered.
in
Macroable at line 49
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 71
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 86
void
__construct(Factory $views, Swift_Mailer $swift, Dispatcher $events = null)
Create a new Mailer instance.
at line 100
void
alwaysFrom(string $address, string|null $name = null)
Set the global from address and name.
at line 112
void
alwaysReplyTo(string $address, string|null $name = null)
Set the global reply-to address and name.
at line 124
void
alwaysTo(string $address, string|null $name = null)
Set the global to address and name.
at line 135
PendingMail
to(mixed $users)
Begin the process of mailing a mailable class instance.
at line 146
PendingMail
bcc(mixed $users)
Begin the process of mailing a mailable class instance.
at line 158
int
raw(string $text, Closure|string $callback)
Send a new message when only a raw text part.
at line 171
void
plain(string $view, array $data, mixed $callback)
Send a new message when only a plain part.
at line 184
void
send(string|array $view, array $data = [], Closure|string $callback = null)
Send a new message using a view.
at line 229
protected mixed
sendMailable(Mailable $mailable)
Send the given mailable.
at line 243
protected array
parseView(string|array $view)
Parse the given view name or array.
at line 280
protected void
addContent(Message $message, string $view, string $plain, string $raw, array $data)
Add the content to a given message.
at line 306
protected string
renderView(string $view, array $data)
Render the given view.
at line 319
protected void
setGlobalTo(Message $message)
Set the global "to" address on the given message.
at line 335
mixed
queue(string|array $view, array $data = [], Closure|string $callback = null, string $queue = null)
Queue a new e-mail message for sending.
at line 353
mixed
onQueue(string $queue, string|array $view, array $data, Closure|string $callback)
Queue a new e-mail message for sending on the given queue.
at line 369
mixed
queueOn(string $queue, string|array $view, array $data, Closure|string $callback)
Queue a new e-mail message for sending on the given queue.
This method didn't match rest of framework's "onQueue" phrasing. Added "onQueue".
at line 384
mixed
later(int $delay, string|array $view, array $data = [], Closure|string $callback = null, string $queue = null)
Queue a new e-mail message for sending after (n) seconds.
at line 403
mixed
laterOn(string $queue, int $delay, string|array $view, array $data, Closure|string $callback)
Queue a new e-mail message for sending after (n) seconds on the given queue.
at line 413
protected Message
createMessage()
Create a new message instance.
at line 440
protected void
sendSwiftMessage(Swift_Message $message)
Send a Swift Message instance.
at line 455
protected bool
shouldSendMessage(Swift_Message $message)
Determines if the message can be sent.
at line 472
protected void
dispatchSentEvent(Message $message)
Dispatch the message sent event.
at line 488
protected void
forceReconnection()
Force the transport to re-connect.
This will prevent errors in daemon queue situations.
at line 498
Factory
getViewFactory()
Get the view factory instance.
at line 508
Swift_Mailer
getSwiftMailer()
Get the Swift Mailer instance.
at line 518
array
failures()
Get the array of failed recipients.
at line 529
void
setSwiftMailer(Swift_Mailer $swift)
Set the Swift Mailer instance.
at line 540
$this
setQueue(Factory $queue)
Set the queue manager instance.