0

I try to generate a link, by using getURL, but some how it keep adding "admin" behind my hostname, what should I do? getURL cannot use in this case?

It use to send out transnational email, if sending thru admin panel, the path on email template will have "admin" which is I don't want this happen.

Please help

0

get Store base url try this

protected $_storeManager;

public function __construct(
    .......................................................
    .......................................................
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    .......................................................
    .......................................................
) {
    .......................................................
    .......................................................
    $this->_storeManager = $storeManager;
    .......................................................
    .......................................................
}

public function execute()
{

    echo $this->_storeManager->getStore()->getBaseUrl();
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.