Commit e60ca18e authored by Stefan Galinski's avatar Stefan Galinski 🎮
Browse files

[TASK] Cleanup

parent 0a28580d
......@@ -29,15 +29,13 @@ use SGalinski\SgMail\Domain\Model\Mail;
use SGalinski\SgMail\Domain\Repository\MailRepository;
use SGalinski\SgMail\Service\BackendService;
use SGalinski\SgMail\Service\MailTemplateService;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException;
use TYPO3\CMS\Extbase\Mvc\Exception\StopActionException;
use TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
use TYPO3\CMS\Extbase\Object\Exception;
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
......@@ -78,9 +76,10 @@ class QueueController extends AbstractController {
* @throws NoSuchCacheException
* @throws SiteNotFoundException
* @throws StopActionException
* @throws UnsupportedRequestTypeException
*/
public function indexAction(string $selectedTemplate = NULL, string $selectedExtension = NULL, array $filters = []): void {
public function indexAction(
string $selectedTemplate = NULL, string $selectedExtension = NULL, array $filters = []
): void {
$this->requireSite();
$this->initSessionAndTemplateFilter($filters);
$this->view->assignMultiple([
......@@ -138,7 +137,6 @@ class QueueController extends AbstractController {
*
* @param Mail $mail
* @throws StopActionException
* @throws UnsupportedRequestTypeException
*/
public function sendMailAction(Mail $mail): void {
$mailService = new MailTemplateService();
......@@ -149,21 +147,19 @@ class QueueController extends AbstractController {
'backend.error_mail_queue',
'sg_mail'
);
$this->addFlashMessage($message, '', FlashMessage::ERROR);
$this->addFlashMessage($message, '', AbstractMessage::ERROR);
$this->redirect('index', NULL, NULL, $this->request->getArguments());
}
if ($mail->getStatus() !== Mail::STATUS_ERROR) {
$this->addFlashMessage(
LocalizationUtility::translate('backend.success_mail_queue', 'sg_mail'),
'',
FlashMessage::OK
LocalizationUtility::translate('backend.success_mail_queue', 'sg_mail')
);
} else {
$this->addFlashMessage(
$mail->getErrorMessage(),
'',
FlashMessage::ERROR
AbstractMessage::ERROR
);
}
......
Markdown is supported
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