Commit 6e17d114 authored by Markus Guenther's avatar Markus Guenther
Browse files

[FEATURE] Add method to generate the mail template marker arrays

parent dd40603f
......@@ -195,6 +195,36 @@ class MailTemplateService {
];
}
/**
* Return default markers for sg_mail
*
* @param string $translationKey
* @param array $marker
* @param string $extensionKey
* @return array
*/
public static function getDefaultTemplateMarker($translationKey, array $marker, $extensionKey = 'sg_mail') {
$languagePath = 'LLL:EXT:sg_register/Resources/Private/Language/locallang.xlf:' . $translationKey;
// Need the key for translations
if (trim($extensionKey) === '') {
return [];
}
$generatedMarker = [];
foreach ($marker as $markerName) {
$generatedMarker[] = [
'marker' => $markerName,
'value' => $languagePath . '.example.' . $markerName,
'description' => $languagePath . '.description.' . $markerName,
'backend_translation_key' => $translationKey . '.example.' . $markerName,
'extension_key' => $extensionKey
];
}
return $generatedMarker;
}
/**
* Get all registered templates
*
......
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