I have created the custom module for customer registration request including an email function also. email function is working fine.
I have customized the email template using Marketing -> Communication ->Newsletter Template -> Add New Template.
When customer registration request the email template is not getting from the customized one.its getting from the module.
What i want to do to use the customized email template?
file -> email_templates.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
<template id="registration_request_template" label="Customer Registration Request" file="registration_request.html" type="html" module="E25media_CustomerRegistration" area="frontend"/>
Controller email
$full_name = $first_name." ".$last_name;
$templateOptions = array('area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $this->_storeManager->getStore()->getId());
$templateVars = array(
'store' => $this->_storeManager->getStore(),
'full_name' => $full_name,
'email' => $email,
'phone' => $phone,
'company' => $company,
'position' => $position,
'vessel' => $vessel
);
$from = array('email' => $email, 'name' => $full_name);
$this->_inlineTranslation->suspend();
$to = array('[email protected]');
$to = $this->getCustomerSupportEmail();
$transport = $this->_transportBuilder->setTemplateIdentifier('registration_request_template')
->setTemplateOptions($templateOptions)
->setTemplateVars($templateVars)
->setFrom($from)
->addTo($to)
->getTransport();
$transport->sendMessage();
$this->_inlineTranslation->resume();