Magento2: Custom email template from Admin

by Ravi   Last Updated September 25, 2018 06:09 AM

I am trying to send an email to the customer once it saves from the Admin. I have called my observer "adminhtml_customer_save_after". Observer called but email template not working. my code is below.

$templateOptions = array('area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $this->_storeManager->getStore()->getId());

        $templateVars = array(
                            'store' => $this->_storeManager->getStore(),
                            'customer_name' => 'John Doe',
                            'message'   => 'Hello World!!.'

        $from = array('email' => "", 'name' => 'Ravi');
        $to = array('email' => "", 'name' => 'Ravi');

        $transport = $this->_transportBuilder->setTemplateIdentifier('hello_template')



Can anyone please look and tell me what I miss?

Related Questions