Controller/Adminhtml/Connector/Trial.php
private function _getIframeFormUrl()
    {
        $formUrl = \Dotdigitalgroup\Email\Helper\Config::API_CONNECTOR_TRIAL_FORM_URL;

        $ipAddress = $this->serverAddress->getServerAddress();
        //get the forward ip address for the request
        if ($ipAddress) {
            $ipAddress = $this->_request->getServer('HTTP_X_FORWARDED_FOR', $ipAddress);
            //get the first ip
            if (strpos($ipAddress, ',') !== false) {
                $ipList = explode(',', $ipAddress);
                $ipAddress = trim(reset($ipList));
            }
        }

        $timezone = $this->_getTimeZoneId();
        $culture = $this->_getCultureId();
        $company = $this->helper->getWebsiteConfig(\Magento\Store\Model\Information::XML_PATH_STORE_INFO_NAME);
        $callback = $this->helper->storeManager->getStore()
                ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB, true) . 'connector/email/accountcallback';

        //query params
        $params = [
            'callback' => $callback,
            'company' => $company,
            'culture' => $culture,
            'timezone' => $timezone,
            'ip' => $ipAddress,
            'code' => $this->trialSetup->generateTemporaryPasscode()
        ];
        $url = $formUrl . '?' . http_build_query($params);

        return $url;
    }
private function _getIframeFormUrl()
    {
        $formUrl = \Dotdigitalgroup\Email\Helper\Config::API_CONNECTOR_TRIAL_FORM_URL;

        $ipAddress = $this->serverAddress->getServerAddress();
        //get the forward ip address for the request
        if ($ipAddress) {
            $ipAddress = $this->_request->getServer('HTTP_X_FORWARDED_FOR', $ipAddress);
            //get the first ip
            if (strpos($ipAddress, ',') !== false) {
                $ipList = explode(',', $ipAddress);
                $ipAddress = trim(reset($ipList));
            }
        }

        $timezone = $this->_getTimeZoneId();
        $culture = $this->_getCultureId();
        $company = $this->helper->getWebsiteConfig(\Magento\Store\Model\Information::XML_PATH_STORE_INFO_NAME);
        $callback = $this->helper->storeManager->getStore()
                ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB, true) . 'connector/email/accountcallback';

        //query params
        $params = [
            'callback' => $callback,
            'company' => $company,
            'culture' => $culture,
            'timezone' => $timezone,
            'ip' => $ipAddress,
            'code' => $this->trialSetup->generateTemporaryPasscode()
        ];
        $url = $formUrl . '?' . http_build_query($params);

        return $url;
    }
private function _getIframeFormUrl ( ) { $ formUrl = \ Dotdigitalgroup \ Email \ Helper \ Config :: API_CONNECTOR_TRIAL_FORM_URL ; $ ipAddress = $ this -> serverAddress -> getServerAddress ( ) ; //get the forward ip address for the request if ( $ ipAddress ) { $ ipAddress = $ this -> _request -> getServer ( 'HTTP_X_FORWARDED_FOR' , $ ipAddress ) ; //get the first ip if ( strpos ( $ ipAddress , ',' ) !== false ) { $ ipList = explode ( ',' , $ ipAddress ) ; $ ipAddress = trim ( reset ( $ ipList ) ) ; } } $ timezone = $ this -> _getTimeZoneId ( ) ; $ culture = $ this -> _getCultureId ( ) ; $ company = $ this -> helper -> getWebsiteConfig ( \ Magento \ Store \ Model \ Information :: XML_PATH_STORE_INFO_NAME ) ; $ callback = $ this -> helper -> storeManager -> getStore ( ) -> getBaseUrl ( \ Magento \ Framework \ UrlInterface :: URL_TYPE_WEB , true ) . 'connector/email/accountcallback' ; //query params $ params = [ 'callback' => $ callback , 'company' => $ company , 'culture' => $ culture , 'timezone' => $ timezone , 'ip' => $ ipAddress , 'code' => $ this -> trialSetup -> generateTemporaryPasscode ( ) ] ; $ url = $ formUrl . '?' . http_build_query ( $ params ) ; return $ url ; }
Generate url for iframe for trial account popup.

@return string
@throws \Magento\Framework\Exception\LocalizedException
Generate url for iframe for trial account popup .