Commit ee1c6182 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[BUGFIX] Removing bug when having no default template in db

parent 1dce853b
......@@ -328,20 +328,19 @@ class MailTemplateService {
// If there is no template for this language, use the default template
if ($template === NULL) {
$templatePath = self::$registerArray[$this->extensionKey][$this->templateName]['templatePath'];
$templateFile = $templatePath . $this->language . '.template.html';
if (file_exists($templateFile)) {
$defaultTemplateContent = file_get_contents($templatePath . $this->language . '.template.html');
} else {
// no language found and no default template
$this->setLanguage($this->tsSettings['templateDefaultLanguage'] ?: 'en');
// does an english default template exist ?
if (file_exists($templatePath . $this->language . '.template.html')) {
$this->sendEmail();
return TRUE;
}
$defaultTemplateFile = $templatePath . 'template.html';
return FALSE;
if (file_exists($defaultTemplateFile)) {
$defaultTemplateContent = file_get_contents($defaultTemplateFile);
} else {
return FALSE;
}
}
}
......
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