Commit f62bb3d3 authored by Oana-Eliza Alexa's avatar Oana-Eliza Alexa
Browse files

use utils

1 merge request!75Draft: Resolve "Redesign Mail"
Pipeline #32448 passed with stages
in 1 minute and 21 seconds
Showing with 4 additions and 2 deletions
+4 -2
......@@ -4,10 +4,12 @@
class Mail implements EndpointInterface
{
private TaskGateway $gateway;
private MailUtils $mailUtils;
function __construct (TaskGateway $gateway)
{
$this->gateway = $gateway;
$this->mailUtils = new MailUtils();
}
/**
......@@ -56,7 +58,7 @@ class Mail implements EndpointInterface
public function processMailTasks (array $tasks): array
{
$result = [];
$fdTasksConf = MailUtils::getMailObjectConfiguration($this->gateway);
$fdTasksConf = $this->mailUtils->getMailObjectConfiguration($this->gateway);
$maxMailsConfig = $this->returnMaximumMailToBeSend($fdTasksConf);
// Increment for anti=spam, starts at 0, each mail task only contain one email, addition if simply + one.
......@@ -97,7 +99,7 @@ class Mail implements EndpointInterface
$attachments = NULL;
}
$mailSentResult = MailUtils::sendMail($setFrom, $setBCC, $recipients, $body, $signature, $subject, $receipt, $attachments);
$mailSentResult = $this->mailUtils->sendMail($setFrom, $setBCC, $recipients, $body, $signature, $subject, $receipt, $attachments);
$result[$task["dn"]] = $this->updateResult($mailSentResult, $task, $fdTasksConf);
// Verification anti-spam max mails to be sent and quit loop if matched
......
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