Skip to content

Commit

Permalink
#1039: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Apr 2, 2024
1 parent e5fc11a commit b815d62
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 20 additions & 0 deletions modules/os2forms_attachment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}`.
18 changes: 17 additions & 1 deletion modules/os2forms_forloeb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 }}`.
6 changes: 2 additions & 4 deletions modules/os2forms_forloeb/src/MaestroHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
));
}

/**
Expand Down

0 comments on commit b815d62

Please sign in to comment.