Esempio n. 1
0
 /**
  * Configure email template
  *
  * @return void
  */
 protected function configureEmailTemplate()
 {
     $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
     $this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
     $this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
     $this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity());
 }
Esempio n. 2
0
 public function execute()
 {
     $email = $this->getRequest()->getParam('email');
     $this->_transportBuilder->setTemplateIdentifier(self::EMAIL_TEMPLATE_TEST_ID);
     $this->_transportBuilder->setFrom($this->_helper->getTestSender());
     $this->_transportBuilder->addTo($email);
     $this->_transportBuilder->setTemplateVars([]);
     $this->_transportBuilder->setTemplateOptions(['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => 1]);
     $transport = $this->_transportBuilder->getTransport();
     $transport->sendMessage();
     /** @var \Magento\Framework\Controller\Result\Json $resultJson */
     $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
     $resultJson->setData(['error' => 0]);
     return $resultJson;
 }