Commit 4073e7fb authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Implemented all_marker for mail templates

parent 934b8ee8
......@@ -332,6 +332,8 @@ class MailTemplateService {
/** @var StandaloneView $emailView */
$emailView = $this->objectManager->get(StandaloneView::class);
$emailView->assignMultiple($this->markers);
$emailView->assign('all_marker', $this->getAllMarker($this->markers));
if (NULL === $defaultTemplateContent) {
$emailView->setTemplateSource(\trim($template->getSubject()));
$subject = $emailView->render();
......@@ -940,4 +942,26 @@ class MailTemplateService {
public function setSubject(string $subject) {
$this->subject = $subject;
}
/**
* Get a single variable containing a list of all markers
*
* @param array $markers
* @return string
*/
private function getAllMarker(array $markers) {
$allMarker = '';
foreach ($markers as $key => $value) {
if (!\is_array($value)) {
$allMarker .= $value . PHP_EOL;
} else {
foreach ($value as $innerKey => $innerValue) {
$allMarker .= $innerValue . PHP_EOL;
}
}
}
return $allMarker;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment