__construct()
create()
enableAllLanguagePreCache()
getDefaultTransport()
getFailureException()
getPreparedMailHandler()
prepareMailContents()
queue()
resetEmailCache()
send()
sendMail()
setEmailCache()
setupTransport()
wrapMailContainer()
_getDefaultSendmailTransport()
_getDefaultSmtpTransport()
_loadEmailTemplate()
_loadEmailTemplatesFromDb()
$_emailCache
$_emailTitle
$_failureException
$_headerMap
$_languageId
$_params
$_preCache
$_preCacheAllLanguages
$_transportSetup
Class to manage preparing and sending emails.
This sends plain text and HTML emails.
package | XenForo_Mail |
---|
__construct(string $emailTitle, array $params, integer | null $languageId)
string
Title of the email template
array
Key-value params to pass to email template
integer
null
Language of email; if null, uses language of current user (if setup)
create(string $emailTitle, array $params, integer | null $languageId) : \XenForo_Mail
string
Title of the email template
array
Key-value params to pass to email template
integer
null
Language of email; if null, uses language of current user (if setup)
enableAllLanguagePreCache()
This will only apply if the email template needs to be loaded.
getDefaultTransport() : \Zend_Mail_Transport_Abstract
\Zend_Mail_Transport_Abstract
getFailureException() : \Exception | null
\Exception
null
getPreparedMailHandler(string $toEmail, string $toName, array $headers, string $fromEmail, string $fromName, string $returnPath) : \Zend_Mail | false
This can be called directly to allow advanced manipulation before sending
string
The email address the email is sent to
string
Name of the person receiving it
array
List of additional headers to send
string
Email address the email should come from; if not specified, uses board default
string
Name the email should come from; if not specified, uses board default
string
The return path of the email (where bounces should go to)
\Zend_Mail
false
prepareMailContents(string | null $emailTitle, array $params) : array | false
string
null
Title of email to send. If not specified, uses value from consructor.
array
null
Params to pass to email template. If not specified, uses value from constructor.
array
false
False if the template can't be found; otherwise array with subject, bodyText, and bodyHtml keysqueue(string $toEmail, string $toName, array $headers, string $fromEmail, string $fromName, string $returnPath) : boolean
string
The email address the email is sent to
string
Name of the person receiving it
array
List of additional headers to send
string
Email address the email should come from; if not specified, uses board default
string
Name the email should come from; if not specified, uses board default
string
The return path of the email (where bounces should go to)
boolean
True on successresetEmailCache()
The MAIL_CONTAINER will still be listed as pre-cacheable.
send(string $toEmail, string $toName, array $headers, string $fromEmail, string $fromName, string $returnPath) : boolean
string
The email address the email is sent to
string
Name of the person receiving it
array
List of additional headers to send
string
Email address the email should come from; if not specified, uses board default
string
Name the email should come from; if not specified, uses board default
string
The return path of the email (where bounces should go to)
boolean
True on successsendMail(\Zend_Mail $mailObj) : boolean
The mail transport system will be setup first, if necessary.
\Zend_Mail
Mail to send.
boolean
setEmailCache(string $emailTitle, integer $languageId, string $template)
string
integer
string
setupTransport(\Zend_Mail_Transport_Abstract $transport)
If no transport is given, the default is selected based on board configuration.
\Zend_Mail_Transport_Abstract
null
If specified, used as default transport; otherwise, use board config
wrapMailContainer(string $subject, string $bodyText, string $bodyHtml) : array
string
string
string
array
Wrapped mail; keys: subject, bodyText, bodyHtml_getDefaultSendmailTransport(array $transportOption) : \Zend_Mail_Transport_Sendmail
array
Deata from option (sendmailReturnPath, etc)
\Zend_Mail_Transport_Sendmail
_getDefaultSmtpTransport(array $transportOption) : \Zend_Mail_Transport_Smtp
array
Data from option (smtpPort, smtpAuth, etc)
\Zend_Mail_Transport_Smtp
_loadEmailTemplate(string $emailTitle) : string
string
string
_loadEmailTemplatesFromDb()
They will be placed on the local email cache.
$_emailCache : array
$_emailTitle : string
$_failureException : \Exception | null
$_headerMap
$_languageId : integer
$_params : array
$_preCache : array
$_preCacheAllLanguages : boolean
This is useful when sending the same email to multiple users (eg, subscription notifications).
$_transportSetup : boolean
This is setup when the first mail is to be sent, but can be explicitly called if desired.