MailerService
class MailerService
Supports E-mail infrastructure for this framework.
Constants
| FRAMEWORK_LAYOUT_PATH |
Path to framework's layouts. |
| FRAMEWORK_TEMPLATE_PATH |
Path to framework's templates. |
| FRAMEWORK_STYLES_PATH |
Path to framework styles. |
| LAYOUT_PATH |
Path to user defined layouts. |
| STYLES_PATH |
Path to user defined styles. |
| TEMPLATE_PATH |
Path to user defined templates. |
Properties
| protected Mailer | $mailer | Mailer object. |
Methods
Creates a new mailer.
Supports ability to use alternative layout paths.
Logs each attempt at sending an E-mail.
Renders template file.
Sends a HTML E-mail.
Generates E-mail using a specified template, layout, and/or css stylesheet.
Sends a text E-mail.
Prepares E-mail content based on template to be sent.
Supports ability to use alternative template paths.
Details
at line 37
__construct()
Creates a new mailer.
at line 50
static protected string
layoutPath(string|null $layoutPath = null)
Supports ability to use alternative layout paths.
at line 67
protected void
mailLogger(string $status, string $to, string $subject, string $htmlBody, string|null $textBody = null, string|null $template = null, string|null $error = null, array|null $attachments = null)
Logs each attempt at sending an E-mail.
at line 120
protected string
renderTemplateFile(string $path, array $data = [])
Renders template file.
at line 137
bool
send(string $to, string $subject, string $htmlBody, string|null $template = null, array $attachments = [])
Sends a HTML E-mail.
at line 196
bool
sendTemplate(string $to, string $subject, string $template, array $data, string|null $layout = null, array $attachments = [], string|null $layoutPath = null, string|null $templatePath = null, string|null $styles = null, string|null $stylesPath = null)
Generates E-mail using a specified template, layout, and/or css stylesheet.
at line 232
bool
sendWithText(string $to, string $subject, string $htmlBody, string $textBody, string|null $template = null, array $attachments = [])
Sends a text E-mail.
at line 287
protected string
template(string $view, array $data = [], string|null $layout = null, string|null $layoutPath = null, string $templatePath, string|null $styles = null, string|null $stylesPath = null)
Prepares E-mail content based on template to be sent.
at line 329
static protected string
templatePath(string|null $templatePath = null)
Supports ability to use alternative template paths.