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;
    }
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;
    }
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 ; }
Create and send mail

@param mixed $data
@return \Laranix\Support\Mail\MailSettings
@throws \Exception
Create and send mail