function template_preprocess_swiftmailer in Swift Mailer 8
Same name and namespace in other branches
- 8.2 swiftmailer.module \template_preprocess_swiftmailer()
Prepares variables for swiftmailer templates.
Default template: swiftmailer.html.twig.
Parameters
array $variables: An associative array containing:
- message: An associative array containing the message array.
- body: The processed body.
- subject: The processed subject.
- base_url: The base url for this site including scheme, without trailing slash.
File
- ./
swiftmailer.module, line 97 - This is the primary module file.
Code
function template_preprocess_swiftmailer(&$variables) {
$variables['base_url'] = $GLOBALS['base_url'];
$variables['subject'] = $variables['message']['subject'];
$variables['body'] = $variables['message']['body'];
}