Commit 692b8561 authored by Ben's avatar Ben
Browse files

Sandbox test

parent 95037825
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -81,12 +81,12 @@ class Ban
     */
     */
    public function ban($banReason = '')
    public function ban($banReason = '')
    {
    {

        error_log("ban called");
        if (!$this->user) {
        if (!$this->user) {
            throw new \Exception('Missing User');
            throw new \Exception('Missing User');
        }
        }


        $banned = $this->banDelegate->ban($this->user, $banReason);

        if ($banned) {
        if ($banned) {
            $this->logoutDelegate->logout($this->user);
            $this->logoutDelegate->logout($this->user);
            $this->queueClient
            $this->queueClient
+10 −3
Original line number Original line Diff line number Diff line
@@ -48,11 +48,18 @@ class Mailer
     */
     */
    public function send($message)
    public function send($message)
    {
    {
        $fromName = $message->from['name'] ?? 'Minds';

        $this->mailer->ClearAllRecipients();
        $this->mailer->ClearAllRecipients();
        $this->mailer->ClearAttachments();
        $this->mailer->ClearAttachments();
        $this->mailer->setFrom($message->from['email'], $message->from['name']);
        error_log(var_export($message->from, true));
        $this->mailer->addReplyTo($message->from['email'], $message->from['name']);

        $this->mailer->From = $message->from['email'];
        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) {
        foreach ($message->to as $to) {
            if ($this->filter->isSpam($to['email'])) {
            if ($this->filter->isSpam($to['email'])) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@ class Email implements Interfaces\QueueRunner


                   $message = unserialize($data['message']);
                   $message = unserialize($data['message']);
                   $mailer->send($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();
        $this->run();
    }
    }