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

[TASK] Fixing backend bugs

parent b0e57679
No related branches found
No related tags found
No related merge requests found
......@@ -104,23 +104,22 @@ class MailController extends ActionController {
$this->view->assign('selectedExtensionKey', $firstEntry);
}
if (isset($selectedLanguageLeft)
&& isset($selectedLanguageRight)
&& isset($selectedTemplate)
&& isset($selectedExtensionKey)
) {
if (isset($selectedTemplate) && isset($selectedExtension)) {
!isset($selectedLanguageLeft) ? $selectedLanguageLeft = 'en' : NULL;
!isset($selectedLanguageRight) ? $selectedLanguageRight = 'en' : NULL;
$this->view->assign('selectedLanguageLeft', $selectedLanguageLeft);
$this->view->assign('selectedLanguageRight', $selectedLanguageRight);
$this->view->assign(
'selectedTemplate', MailTemplateService::getRegisterArray()[$selectedExtensionKey][$selectedTemplateKey]
'selectedTemplate', MailTemplateService::getRegisterArray()[$selectedExtension][$selectedTemplate]
);
$this->view->assign('selectedTemplateKey', $selectedTemplateKey);
$this->view->assign('selectedExtensionKey', $selectedExtensionKey);
$this->view->assign('selectedTemplateKey', $selectedTemplate);
$this->view->assign('selectedExtensionKey', $selectedExtension);
/** @var /SGalinski/SgMail/Domain/Model/Template $result */
$templateLeft = $this->templateRepository->findTemplate(
$selectedExtensionKey, $selectedTemplateKey, $selectedLanguageLeft
$selectedExtension, $selectedTemplate, $selectedLanguageLeft
)->getFirst();
$this->view->assign(
......@@ -265,6 +264,15 @@ class MailController extends ActionController {
public function sendTestMailAction(
$emailAddress, $selectedExtensionKey, $selectedTemplateKey, $selectedLanguageLeft
) {
if (!filter_var($this->settings['mail']['test']['from'], FILTER_VALIDATE_EMAIL)) {
$message = LocalizationUtility::translate('backend.invalid_test_email', 'sg_mail');
$this->addFlashMessage($message, '', FlashMessage::ERROR);
$arguments = $this->request->getArguments();
$this->redirect('index', NULL, NULL, $arguments);
}
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var \SGalinski\SgMail\Service\MailTemplateService $mailTemplateService */
$mailTemplateService = $objectManager->get(MailTemplateService::class);
......
......@@ -13,6 +13,14 @@
<source>Description</source>
<target>Beschreibung</target>
</trans-unit>
<trans-unit id="backend.failure_mail" approved="yes">
<source>There was an error when sending the Test E-Mail. Please check your Configuration</source>
<target>Ein Fehler ist aufgetreten. Bitte überprüfen Sie die Konfiguration</target>
</trans-unit>
<trans-unit id="backend.invalid_test_email" approved="yes">
<source>The Test E-Mail Address in your Configuration is invalid.</source>
<target>Die E-Mail Addresse in der Konfiguration ist nicht gültig.</target>
</trans-unit>
<trans-unit id="backend.marker" approved="yes">
<source>Marker</source>
<target>Marker</target>
......
......@@ -12,6 +12,12 @@
<trans-unit id="backend.description">
<source>Description</source>
</trans-unit>
<trans-unit id="backend.failure_mail">
<source>There was an error when sending the Test E-Mail. Please check your Configuration</source>
</trans-unit>
<trans-unit id="backend.invalid_test_email">
<source>The Test E-Mail Address in your Configuration is invalid.</source>
</trans-unit>
<trans-unit id="backend.marker">
<source>Marker</source>
</trans-unit>
......
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