public function beforeCreateAccount(
        \Magento\Customer\Model\AccountManagement $subject,
        \Magento\Customer\Api\Data\CustomerInterface $customer,
        $password = null,
        $redirectUrl = ''
    ) {
        $addrs = $customer->getAddresses();
        if (is_array($addrs)) {
            foreach ($addrs as $addr) {
                $countryCode = $addr->getCountryId();
                $this->hlpReg->putCustomerCountry($countryCode);
                $isBilling = $addr->isDefaultBilling();
                if ($isBilling) break; // get any address but exit the loop if default billing
            }
        }
        return [$customer, $password, $redirectUrl];
    }
public function beforeCreateAccount(
        \Magento\Customer\Model\AccountManagement $subject,
        \Magento\Customer\Api\Data\CustomerInterface $customer,
        $password = null,
        $redirectUrl = ''
    ) {
        $addrs = $customer->getAddresses();
        if (is_array($addrs)) {
            foreach ($addrs as $addr) {
                $countryCode = $addr->getCountryId();
                $this->hlpReg->putCustomerCountry($countryCode);
                $isBilling = $addr->isDefaultBilling();
                if ($isBilling) break; // get any address but exit the loop if default billing
            }
        }
        return [$customer, $password, $redirectUrl];
    }
public function beforeCreateAccount ( \ Magento \ Customer \ Model \ AccountManagement $ subject , \ Magento \ Customer \ Api \ Data \ CustomerInterface $ customer , $ password = null , $ redirectUrl = '' ) { $ addrs = $ customer -> getAddresses ( ) ; if ( is_array ( $ addrs ) ) { foreach ( $ addrs as $ addr ) { $ countryCode = $ addr -> getCountryId ( ) ; $ this -> hlpReg -> putCustomerCountry ( $ countryCode ) ; $ isBilling = $ addr -> isDefaultBilling ( ) ; if ( $ isBilling ) break ; // get any address but exit the loop if default billing } } return [ $ customer , $ password , $ redirectUrl ] ; }
Extract country code and save into Magento registry when customer is created through adminhtml.

@param \Magento\Customer\Model\AccountManagement $subject
@param \Magento\Customer\Api\Data\CustomerInterface $customer
@param null $password
@param string $redirectUrl
@return array
Extract country code and save into Magento registry when customer is created through adminhtml .