Skip to content
Snippets Groups Projects
Commit 35757e21 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing multiple word tempalte name / directory mapping

parent f7ec3303
No related branches found
No related tags found
1 merge request!3New version 4 1
...@@ -50,6 +50,7 @@ class MailTemplateService { ...@@ -50,6 +50,7 @@ class MailTemplateService {
const MARKER_TYPE_ARRAY = 'Array'; const MARKER_TYPE_ARRAY = 'Array';
const MARKER_TYPE_OBJECT = 'Object'; const MARKER_TYPE_OBJECT = 'Object';
const DEFAULT_LANGUAGE = 'default'; const DEFAULT_LANGUAGE = 'default';
const DEFAULT_TEMPLATE_PATH = 'Resources/Private/Templates/SgMail/';
/** /**
* @var array $registerArray * @var array $registerArray
...@@ -757,9 +758,15 @@ class MailTemplateService { ...@@ -757,9 +758,15 @@ class MailTemplateService {
private static function registerByConfigArray(array $config = [], $extensionName) { private static function registerByConfigArray(array $config = [], $extensionName) {
$extensionKey = $config['extension_key']; $extensionKey = $config['extension_key'];
$templateKey = $config['template_key']; $templateKey = $config['template_key'];
$templatePath = ExtensionManagementUtility::extPath(
$extensionName // transform template directory name: your_templates => YourTemplates/
) . 'Resources/Private/Templates/SgMail/' . ucfirst($config['template_key'] . '/'); $templateDirectoryParts = GeneralUtility::trimExplode('_', $config['template_key']);
$templateDirectory = '';
foreach ($templateDirectoryParts as $part) {
$templateDirectory .= ucfirst($part);
}
$templateDirectory .= '/';
$templatePath = ExtensionManagementUtility::extPath($extensionName) . self::DEFAULT_TEMPLATE_PATH . $templateDirectory;
if ($config['template_path']) { if ($config['template_path']) {
$templatePath = $config['template_key']; $templatePath = $config['template_key'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment