diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a38c035..16547769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa - [#84](https://github.com/OS2Forms/os2forms/pull/84) Added digital post test command. - [#95](https://github.com/OS2Forms/os2forms/pull/95) - Added `base_url` variable to twig templates. + - Added `base_url` variable to twig templates. + - Tokenized all Maestro notification html. ## [3.14.1] 2024-01-16 diff --git a/modules/os2forms_attachment/README.md b/modules/os2forms_attachment/README.md index 09ff6cf1..3dfea56d 100644 --- a/modules/os2forms_attachment/README.md +++ b/modules/os2forms_attachment/README.md @@ -13,3 +13,23 @@ To add custom headers/footer ```admin/structure/webform/config/os2forms_attachme To specify headers/footers that will override the default ones on a global level (**Third party settings** -> **Entity print** section): ```admin/structure/webform/config``` To specify headers/footers that will override the default ones on a form level (**Third party settings** -> **Entity print** section): ```/admin/structure/webform/manage/[webform]/settings``` + + +# Overwriting templates + +With some setups it might be necessary to overwrite templates +in order to access stylesheets. + +For this reason the `base_url` variable has been added for use in templates. +Set it in `settings.local.php` + +```php +/** + * Base url. + * + * Used to specify full path to stylesheets in templates. + */ +$settings['base_url'] = 'http://nginx:8080'; +``` + +and use it in templates with `{{ base_url }}`. diff --git a/modules/os2forms_forloeb/README.md b/modules/os2forms_forloeb/README.md index 5d00e940..b7d0ed0a 100644 --- a/modules/os2forms_forloeb/README.md +++ b/modules/os2forms_forloeb/README.md @@ -19,7 +19,7 @@ You can also install the module by using Drush: Maestro 3.1 adds a `hook_webform_submission_form_alter` hook which we utilize to send assignment, reminder and escalation notifications by adding a *Maestro notification* handler to a form that spawns a Maestro workflow or assigns a -task. If the notification recipient is identified by an an email address, the +task. If the notification recipient is identified by an email address, the notification is sent as an email, and if the identifier is a Danish CPR number, the notifications is sent as digital post. @@ -44,3 +44,19 @@ must be processed asynchronously. Specify the queue handling notification jobs. #### Templates Define templates for emails and digital post (PDF). + +With some setups it might be necessary to import stylesheets with a full path. + +For this reason the `base_url` variable has been added for use in templates. +Set it in `settings.local.php` + +```php +/** + * Base url. + * + * Used to specify full path to stylesheets in templates. + */ +$settings['base_url'] = 'http://nginx:8080'; +``` + +and use it in templates with `{{ base_url }}`. diff --git a/modules/os2forms_forloeb/src/MaestroHelper.php b/modules/os2forms_forloeb/src/MaestroHelper.php index 8f8e24a9..5adf6787 100644 --- a/modules/os2forms_forloeb/src/MaestroHelper.php +++ b/modules/os2forms_forloeb/src/MaestroHelper.php @@ -620,13 +620,11 @@ private function renderHtml( $html = trim((string) $this->webformThemeManager->renderPlain($build)); - $html = $this->tokenManager->replace( + return Markup::create($this->tokenManager->replace( $html, $submission, $maestroTokenData - ); - - return Markup::create($html); + )); } /**