Commit 530f8561 authored by Ben Hayward's avatar Ben Hayward

Updated

1 merge request!345WIP: [Sprint/OldfashionedOwl](fix): Updated from address in ban email to info@minds.com
Pipeline #89881208 passed with stages
in 9 minutes and 31 seconds
......@@ -7,7 +7,6 @@ use Minds\Cli;
use Minds\Interfaces;
use Minds\Exceptions;
use Minds\Entities;
use Minds\Core\Di\Di;
use Minds\Core\Channels\Ban;
class User extends Cli\Controller implements Interfaces\CliControllerInterface
......
......@@ -48,20 +48,21 @@ class Mailer
*/
public function send($message)
{
$fromName = $message->from['name'] ?? 'Minds';
$this->mailer->ClearAllRecipients();
$this->mailer->ClearAttachments();
if (isset($message->getReplyTo()['email'])) {
if ($message->getReplyTo()) {
$this->mailer->ClearReplyTos();
$this->mailer->addReplyTo(
$message->getReplyTo()['email'],
$message->getReplyTo()['name']
$message->getReplyTo()['name'] ?? 'Minds'
);
}
$this->mailer->setFrom($message->from['email'], $fromName);
$this->mailer->setFrom(
$message->from['email'],
$message->from['name'] ?? 'Minds'
);
foreach ($message->to as $to) {
if ($this->filter->isSpam($to['email'])) {
......
......@@ -117,11 +117,11 @@ class Message
/**
* Get reply-to.
*
* @return Message returns array containing email and username.
* @return array array containing email and username.
*/
public function getReplyTo(): array
public function getReplyTo()
{
return $this->replyTo;
return $this->replyTo ?? [];
}
/**
* Set reply-to.
......@@ -134,7 +134,7 @@ class Message
public function setReplyTo($email, $name = 'Minds'): Message
{
$this->replyTo['email'] = $email;
$this->replyTo['username'] = $name;
$this->replyTo['name'] = $name;
return $this;
}
}
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