class EmailTemplateService (View source)

Methods

__construct(ConfigurationInterface $config)

No description

string
render(string $template, array $variables = [])

Render an email template

array
renderNewAccountEmail(string $username, string $password, string $fullname = '')

Render new account email templates

array
renderPasswordResetEmail(string $name, string $resetUrl, int $expireMinutes)

Render password reset email templates

array
renderMfaVerificationEmail(string $verificationCode, int $expiresAt, string|null $timezone = null)

Render MFA verification email templates

array
renderUsernameRecoveryEmail(string $name, array $usernames, string|null $loginUrl)

Render username recovery email templates

array
renderZoneAccessGrantedEmail(string $zoneName, string $recipientName, string $grantedByName, string $grantedByEmail, string $grantedAt, string|null $zoneEditUrl)

Render zone access granted email templates

array
renderZoneAccessRevokedEmail(string $zoneName, string $recipientName, string $revokedByName, string $revokedAt)

Render zone access revoked email templates

bool
hasCustomTemplate(string $template)

Check if a custom template exists

array
getTemplatePaths()

Get available template paths for debugging

Details

__construct(ConfigurationInterface $config)

No description

Parameters

ConfigurationInterface $config

string render(string $template, array $variables = [])

Render an email template

Parameters

string $template

Template name (e.g., 'new-account.html.twig')

array $variables

Variables to pass to the template

Return Value

string

Rendered template content

Exceptions

SyntaxError

array renderNewAccountEmail(string $username, string $password, string $fullname = '')

Render new account email templates

Parameters

string $username

User's username

string $password

User's password

string $fullname

User's full name

Return Value

array

['html' => string, 'text' => string, 'subject' => string]

Exceptions

LoaderError
RuntimeError
SyntaxError

array renderPasswordResetEmail(string $name, string $resetUrl, int $expireMinutes)

Render password reset email templates

Parameters

string $name

User's name

string $resetUrl

Password reset URL

int $expireMinutes

Expiration time in minutes

Return Value

array

['html' => string, 'text' => string, 'subject' => string]

Exceptions

LoaderError
RuntimeError
SyntaxError

array renderMfaVerificationEmail(string $verificationCode, int $expiresAt, string|null $timezone = null)

Render MFA verification email templates

Parameters

string $verificationCode

Verification code

int $expiresAt

Expiration timestamp

string|null $timezone

Optional IANA timezone for the recipient; falls back to the global default

Return Value

array

['html' => string, 'text' => string, 'subject' => string]

Exceptions

LoaderError
RuntimeError
SyntaxError

array renderUsernameRecoveryEmail(string $name, array $usernames, string|null $loginUrl)

Render username recovery email templates

Parameters

string $name

User's name

array $usernames

Usernames associated with the email

string|null $loginUrl

URL to the login page, or null to omit the link

Return Value

array

['html' => string, 'text' => string, 'subject' => string]

Exceptions

LoaderError
RuntimeError
SyntaxError

array renderZoneAccessGrantedEmail(string $zoneName, string $recipientName, string $grantedByName, string $grantedByEmail, string $grantedAt, string|null $zoneEditUrl)

Render zone access granted email templates

Parameters

string $zoneName

Zone name that access was granted to

string $recipientName

Recipient's full name or username

string $grantedByName

Name of person who granted access

string $grantedByEmail

Email of person who granted access

string $grantedAt

Timestamp of when access was granted

string|null $zoneEditUrl

URL to edit the zone, or null to omit the link

Return Value

array

['html' => string, 'text' => string, 'subject' => string]

Exceptions

LoaderError
RuntimeError
SyntaxError

array renderZoneAccessRevokedEmail(string $zoneName, string $recipientName, string $revokedByName, string $revokedAt)

Render zone access revoked email templates

Parameters

string $zoneName

Zone name that access was revoked from

string $recipientName

Recipient's full name or username

string $revokedByName

Name of person who revoked access

string $revokedAt

Timestamp of when access was revoked

Return Value

array

['html' => string, 'text' => string, 'subject' => string]

Exceptions

LoaderError
RuntimeError
SyntaxError

bool hasCustomTemplate(string $template)

Check if a custom template exists

Parameters

string $template

Template name

Return Value

bool

array getTemplatePaths()

Get available template paths for debugging

Return Value

array