src/Service/Emailer.php
protected function getDomain()
    {
        if (!empty($this->sDomain)) {
            return $this->sDomain;
        } elseif (site_url() === '/') {
            $oInput    = Factory::service('Input');
            $sHost     = $oInput->server('SERVER_NAME');
            $sProtocol = $oInput->server('REQUEST_SCHEME') ?: 'http';
            if (empty($sHost)) {
                throw new HostNotKnownException('Failed to resolve host; email links will be incomplete.');
            } else {
                $this->sDomain = $sProtocol . '://' . $sHost . '/';
            }
        } else {
            $this->sDomain = site_url();
        }

        $this->sDomain = rtrim($this->sDomain, '/');
        return $this->sDomain;
    }
protected function getDomain()
    {
        if (!empty($this->sDomain)) {
            return $this->sDomain;
        } elseif (site_url() === '/') {
            $oInput    = Factory::service('Input');
            $sHost     = $oInput->server('SERVER_NAME');
            $sProtocol = $oInput->server('REQUEST_SCHEME') ?: 'http';
            if (empty($sHost)) {
                throw new HostNotKnownException('Failed to resolve host; email links will be incomplete.');
            } else {
                $this->sDomain = $sProtocol . '://' . $sHost . '/';
            }
        } else {
            $this->sDomain = site_url();
        }

        $this->sDomain = rtrim($this->sDomain, '/');
        return $this->sDomain;
    }
protected function getDomain ( ) { if ( ! empty ( $ this -> sDomain ) ) { return $ this -> sDomain ; } elseif ( site_url ( ) === '/' ) { $ oInput = Factory :: service ( 'Input' ) ; $ sHost = $ oInput -> server ( 'SERVER_NAME' ) ; $ sProtocol = $ oInput -> server ( 'REQUEST_SCHEME' ) ? : 'http' ; if ( empty ( $ sHost ) ) { throw new HostNotKnownException ( 'Failed to resolve host; email links will be incomplete.' ) ; } else { $ this -> sDomain = $ sProtocol . '://' . $ sHost . '/' ; } } else { $ this -> sDomain = site_url ( ) ; } $ this -> sDomain = rtrim ( $ this -> sDomain , '/' ) ; return $ this -> sDomain ; }
Returns the domain to use for the email

@return string
@throws HostNotKnownException
@throws \Nails\Common\Exception\FactoryException
Returns the domain to use for the email