Mailer
class Mailer extends Mailer
Adapted from october\rain\mail\Mailer
Traits
Adds event related features to any class.
Properties
protected array | $emitterSingleEvents | from EventEmitter | |
protected array | $emitterEvents | from EventEmitter | |
protected array | $emitterEventSorted | from EventEmitter | |
protected string | $pretendingOriginal |
Methods
Create a new event binding.
Create a new event binding that fires once only
Sort the listeners for a given event by priority.
Fire an event and call the listeners.
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
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.
Build the mailable for a queued e-mail job.
Send a new message when only a raw text part.
Helper for raw() method, send a new message when only a raw text part.
Process a recipients object, which can look like the following:
- (string) [email protected]
- (object) ['email' => '[email protected]', 'name' => 'Adam Person']
- (array) ['[email protected]' => 'Adam Person', ...]
- (array) [ (object|array) ['email' => '[email protected]', 'name' => 'Adam Person'], [...] ]
Add the content to a given message.
Add the raw content to a given message.
Tell the mailer to not really send messages.
No description
No description
Details
in
EventEmitter at line 36
EventEmitter
bindEvent(string $event, callable $callback, int $priority = 0)
Create a new event binding.
in
EventEmitter at line 52
EventEmitter
bindEventOnce(string $event, callable $callback)
Create a new event binding that fires once only
in
EventEmitter at line 66
protected void
emitterEventSortEvents(string $eventName)
Sort the listeners for a given event by priority.
in
EventEmitter at line 84
EventEmitter
unbindEvent(string $event = null)
Destroys an event binding.
in
EventEmitter at line 124
string|array
fireEvent(string $event, array $params = [], bool $halt = false)
Fire an event and call the listeners.
in
EventEmitter at line 178
mixed
fireSystemEvent(string $event, array $params = [], bool $halt = true)
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
For example:
$this->fireSystemEvent('admin.form.myEvent', ['my value']);
Is equivalent to:
$this->fireEvent('form.myEvent', ['myvalue'], true);
Event::fire('admin.form.myEvent', [$this, 'myvalue'], true);
at line 33
void
send(string|array $view, array $data = [], Closure|string $callback = null)
Send a new message using a view.
at line 145
mixed
sendTo(array $recipients, string|array $view, array $data = [], mixed $callback = null, array $options = [])
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.
at line 187
mixed
queue(string|array $view, array $data = null, Closure|string $callback = null, string|null $queue = null)
Queue a new e-mail message for sending.
at line 210
mixed
queueOn(string $queue, string|array $view, array $data = null, Closure|string $callback = null)
Queue a new e-mail message for sending on the given queue.
at line 225
mixed
later(int $delay, string|array $view, array $data = null, Closure|string $callback = null, string|null $queue = null)
Queue a new e-mail message for sending after (n) seconds.
at line 249
mixed
laterOn(string $queue, int $delay, string|array $view, array $data = null, Closure|string $callback = null)
Queue a new e-mail message for sending after (n) seconds on the given queue.
at line 260
protected mixed
buildQueueMailable($view, $data, mixed $callback, $queueName = null)
Build the mailable for a queued e-mail job.
at line 284
void
raw($view, mixed $callback)
Send a new message when only a raw text part.
at line 304
int
rawTo(array $recipients, string $view, mixed $callback = null, array $options = [])
Helper for raw() method, send a new message when only a raw text part.
at line 325
protected array
processRecipients(mixed $recipients)
Process a recipients object, which can look like the following:
- (string) [email protected]
- (object) ['email' => '[email protected]', 'name' => 'Adam Person']
- (array) ['[email protected]' => 'Adam Person', ...]
- (array) [ (object|array) ['email' => '[email protected]', 'name' => 'Adam Person'], [...] ]
at line 376
protected void
addContent(Message $message, string $view, string $plain, string $raw, array $data)
Add the content to a given message.
at line 463
protected void
addContentRaw(Message $message, string $html, string $text)
Add the raw content to a given message.
at line 480
void
pretend(bool $value = true)
Tell the mailer to not really send messages.
at line 492
sendToMany($recipients, $view, array $data = [], $callback = null, $queue = false)
No description
at line 512
protected
parseView($view)
No description