PrepareEmailTrait
Table of Contents
Methods
- loadEmail() : Email|null
- Loads the template by key, also when the operator turned it off: the caller checks `isActive()` / `isActiveTranslation()` itself, a disabled template is not an error.
- prepareEmailBody() : string
- Renders a template text into the wrapper `email.latte` for later sending ({@see SendEmailTrait::sendRenderedEmail()}).
Methods
loadEmail()
Loads the template by key, also when the operator turned it off: the caller checks `isActive()` / `isActiveTranslation()` itself, a disabled template is not an error.
public
loadEmail(string $emailKey) : Email|null
Parameters
- $emailKey : string
Return values
Email|nullprepareEmailBody()
Renders a template text into the wrapper `email.latte` for later sending ({@see SendEmailTrait::sendRenderedEmail()}).
public
prepareEmailBody(string $emailSubject, string $emailBody[, array<string, mixed> $values = [] ]) : string
Returns an empty string when there is nothing to render or the render failed (logged in
email.render); the caller must not store or send such a body.
Parameters
- $emailSubject : string
- $emailBody : string
- $values : array<string, mixed> = []