public function send($data = null): ?MailSettings
    {
        try {
            $settings = $this->createSettings($data);

            $settings->hasRequiredSettings();

            $this->mailer->send(
                $this->createMailable($settings)
            );
        } catch (\Exception $e) {
            Log::error($e);

            $env = $this->config->get('app.env', 'production');

            if (!in_array($env, ['production', 'prod', 'live'])) {
                throw $e;
            }
        }

        return $settings ?? null;
    }