Commit 692b8561 authored by Ben Hayward's avatar Ben Hayward

Sandbox test

1 merge request!345WIP: [Sprint/OldfashionedOwl](fix): Updated from address in ban email to info@minds.com
Pipeline #89874542 canceled with stages
in 1 minute and 8 seconds
......@@ -81,12 +81,12 @@ class Ban
*/
public function ban($banReason = '')
{
error_log("ban called");
if (!$this->user) {
throw new \Exception('Missing User');
}
$banned = $this->banDelegate->ban($this->user, $banReason);
if ($banned) {
$this->logoutDelegate->logout($this->user);
$this->queueClient
......
......@@ -48,11 +48,18 @@ class Mailer
*/
public function send($message)
{
$fromName = $message->from['name'] ?? 'Minds';
$this->mailer->ClearAllRecipients();
$this->mailer->ClearAttachments();
$this->mailer->setFrom($message->from['email'], $message->from['name']);
$this->mailer->addReplyTo($message->from['email'], $message->from['name']);
$this->mailer->From = $message->from['email'];
error_log(var_export($message->from, true));
if (isset($message->from)) {
$this->mailer->ClearReplyTos();
$this->mailer->addReplyTo($message->from['email'], $fromName);
}
$this->mailer->setFrom($message->from['email'], $fromName);
foreach ($message->to as $to) {
if ($this->filter->isSpam($to['email'])) {
......
......@@ -27,7 +27,7 @@ class Email implements Interfaces\QueueRunner
$message = unserialize($data['message']);
$mailer->send($message);
echo "[priority email]: delivered to {$message->to[0]['name']} ($message->subject) \n";
echo "[email]: delivered to {$message->to[0]['name']} ($message->subject) \n";
});
$this->run();
}
......
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