public function debugMode($mode)
    {
        if (!isset($this->debugMode[$mode])) {
            $mode = 'production';
        }

        $this->mail->SMTPDebug = $this->debugMode[$mode];
        $this->mail->Debugoutput = function ($str, $mode) {
            logger(LogLevel::DEBUG, $str, ['debugMode' => $mode]);
        };

        return $this;
    }