MailerTrait
Sends a ready message: mailer choice (sender address SMTP, default SMTP or sendmail) and the emergency `mail.blocked` switch.
Requires $smtpSettingManager, $settingContext and $paramsConfig. Email templates
and the queue are handled by SendEmailTrait, which uses this trait; the queue
(EmailQueueManager) needs only sending.
Table of Contents
Methods
- dispatchQueuedEmail() : Result
- Sends a queued email directly through the mailer (bypasses the queue).
- isMailBlocked() : bool
- Returns `true` when the emergency sending switch is on in neon (`params.1.mail.blocked`).
- initializeDefaultMailer() : Mailer
- initializeMailer() : Mailer
Methods
dispatchQueuedEmail()
Sends a queued email directly through the mailer (bypasses the queue).
public
dispatchQueuedEmail(EmailQueue $queueItem) : Result
Used by the cron job that processes the queue.
Parameters
- $queueItem : EmailQueue
Return values
ResultisMailBlocked()
Returns `true` when the emergency sending switch is on in neon (`params.1.mail.blocked`).
public
isMailBlocked() : bool
The check lives here on purpose: every send passes through this place, including
dispatchQueuedEmail() from cron, so the admin setting email.sending.mode
cannot bypass it.
Return values
boolinitializeDefaultMailer()
private
initializeDefaultMailer() : Mailer
Return values
MailerinitializeMailer()
private
initializeMailer([string|null $from = null ]) : Mailer
Parameters
- $from : string|null = null