protected function createSettings($data = null): MailSettings
    {
        if (method_exists($this, 'getPayload')) {
            $data = $this->getPayload($data);
        }

        if ($data instanceof MailSettings) {
            return $data;
        }

        return new $this->settings($data);
    }