Commit 4c3d0f32 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Refactoring naming and removing unnecessary default template creation

parent 07ddf861
......@@ -91,7 +91,7 @@ class MailTemplateService {
/**
* @var array content
*/
private $content = [];
private $markers = [];
/**
* @var string subject
......@@ -113,24 +113,18 @@ class MailTemplateService {
* @param string $templateName
* @param string $templatePath
* @param string $description
* @param array $marker
* @param array $markers
* @return string
*/
public static function registerTemplate($extension, $templateName, $templatePath, $description, array $marker) {
public static function registerTemplate($extension, $templateName, $templatePath, $description, array $markers) {
MailTemplateService::$registerArray[$extension][$templateName] = [
'templatePath' => $templatePath,
'description' => $description,
'marker' => $marker,
'marker' => $markers,
'extension' => $extension,
'templateName' => $templateName
];
$defaultLangFile = $templatePath . 'en.sg_mail.locallang.html';
if (!file_exists($defaultLangFile)) {
$langFileContent = '';
file_put_contents($defaultLangFile, $langFileContent);
}
}
/**
......@@ -143,7 +137,7 @@ class MailTemplateService {
}
/**
* send the Email
* Send the Email
*/
public function sendEmail() {
$registerArray = MailTemplateService::getRegisterArray();
......@@ -154,7 +148,7 @@ class MailTemplateService {
$emailView->setTemplatePathAndFilename(
$templateEntry['templatePath'] . $this->language . '.sg_mail.locallang.html'
);
$emailView->assignMultiple($this->content);
$emailView->assignMultiple($this->markers);
$emailBody = $emailView->render();
if ($this->ignoreMailQueue) {
......@@ -287,11 +281,11 @@ class MailTemplateService {
}
/**
* @param array $content
* @param array $markers
* @return MailTemplateService
*/
public function setContent(array $content) {
$this->content = $content;
public function setMarkers(array $markers) {
$this->markers = $markers;
return $this;
}
}
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