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

[TASK] Implementing language filter for mail queue

parent 93d7f71c
......@@ -91,7 +91,7 @@ class MailRepository extends AbstractRepository {
if ($filters['filterLanguage'] && $filters['filterLanguage'] !== 0
&& $filters['filterLanguage'] !== '0' && $filters['filterLanguage'] !== ''
) {
$constraintsAnd[] = $query->equals('template_name', $filters['filterTemplate']);
$constraintsAnd[] = $query->equals('language', $filters['filterLanguage']);
}
if ($filters['sent']) {
......
......@@ -378,11 +378,11 @@ class MailTemplateService {
$currentTimestamp = $dateTime->getTimestamp();
$this->addMailToMailQueue(
$this->extensionKey, $this->templateName, $subject, $emailBody, $this->priority,
$currentTimestamp, TRUE, $currentTimestamp
$currentTimestamp, TRUE, $currentTimestamp, $this->language
);
} else {
$this->addMailToMailQueue($this->extensionKey, $this->templateName, $subject, $emailBody, $this->priority);
$this->addMailToMailQueue($this->extensionKey, $this->templateName, $subject, $emailBody, $this->priority, 0, FALSE, 0, $this->language);
}
return TRUE;
......@@ -398,16 +398,18 @@ class MailTemplateService {
* @param int $sendingTime
* @param int $priority
* @param int $lastSendingTime
* @param string $language
* @param bool $sent
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/
private function addMailToMailQueue(
$extensionKey, $templateName, $subject, $emailBody, $priority, $sendingTime = 0, $sent = FALSE,
$lastSendingTime = 0
$lastSendingTime = 0, $language = 'en'
) {
$mail = $this->objectManager->get(Mail::class);
$mail->setExtensionKey($extensionKey);
$mail->setTemplateName($templateName);
$mail->setLanguage($language);
$mail->setFromAddress($this->fromAddress);
$mail->setFromName($this->fromName);
$mail->setToAddress($this->toAddresses);
......
......@@ -26,9 +26,10 @@
</div>
</f:if>
<f:render partial="Queue/Filter" arguments="{filterFields: filterFields, filters: filters, languages: languages, templatesFilter: templatesFilter}" />
<f:if condition="{queue -> f:count()} > 0">
<f:then>
<f:render partial="Queue/Filter" arguments="{filterFields: filterFields, filters: filters, languages: languages, templatesFilter: templatesFilter}" />
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="tx_sgmail_domain_model_mail" class="table table-striped table-hover">
......
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