예제 #1
0
 public function testSetTemplateVars()
 {
     $templateVars = ['opt1', 'opt2'];
     $this->template->setTemplateVars($templateVars);
     $result = $this->template->getTemplateVars();
     $this->assertEquals($templateVars, $result);
 }
예제 #2
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());
 }
예제 #3
0
파일: Sender.php 프로젝트: aiesh/magento2
 /**
  * @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);
 }