public function testSetTemplateVars() { $templateVars = ['opt1', 'opt2']; $this->template->setTemplateVars($templateVars); $result = $this->template->getTemplateVars(); $this->assertEquals($templateVars, $result); }
/** * 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()); }
/** * @param Order $order * @return void */ protected function prepareTemplate(Order $order) { $this->templateContainer->setTemplateOptions($this->getTemplateOptions()); if ($order->getCustomerIsGuest()) { $templateId = $this->identityContainer->getGuestTemplateId(); $customerName = $order->getBillingAddress()->getName(); } else { $templateId = $this->identityContainer->getTemplateId(); $customerName = $order->getCustomerName(); } $this->identityContainer->setCustomerName($customerName); $this->identityContainer->setCustomerEmail($order->getCustomerEmail()); $this->templateContainer->setTemplateId($templateId); }