當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Email::viewBuilder方法代碼示例

本文整理匯總了PHP中Cake\Mailer\Email::viewBuilder方法的典型用法代碼示例。如果您正苦於以下問題:PHP Email::viewBuilder方法的具體用法?PHP Email::viewBuilder怎麽用?PHP Email::viewBuilder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cake\Mailer\Email的用法示例。


在下文中一共展示了Email::viewBuilder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send

 /**
  * Sends email.
  *
  * @param string $action The name of the mailer action to trigger.
  * @param array $args Arguments to pass to the triggered mailer action.
  * @param array $headers Headers to set.
  * @return array
  * @throws \Cake\Mailer\Exception\MissingActionException
  * @throws \BadMethodCallException
  */
 public function send($action, $args = [], $headers = [])
 {
     if (!method_exists($this, $action)) {
         throw new MissingActionException(['mailer' => $this->getName() . 'Mailer', 'action' => $action]);
     }
     $this->_email->setHeaders($headers);
     if (!$this->_email->viewBuilder()->template()) {
         $this->_email->viewBuilder()->template($action);
     }
     call_user_func_array([$this, $action], $args);
     $result = $this->_email->send();
     $this->reset();
     return $result;
 }
開發者ID:hossain-seaos,項目名稱:cakephp,代碼行數:24,代碼來源:Mailer.php

示例2: send

 /**
  * Send notification
  *
  * @param \CvoTechnologies\Notifier\Notification $notification Notification instance.
  * @return array
  */
 public function send(Notification $notification)
 {
     $email = new Email();
     $email->profile($this->config('profile'));
     $email->to($notification->to(null, static::TYPE));
     $email->subject($notification->title());
     $email->viewBuilder()->templatePath($notification->viewBuilder()->templatePath());
     $email->viewBuilder()->template($notification->viewBuilder()->template());
     $email->viewBuilder()->plugin($notification->viewBuilder()->plugin());
     $email->viewBuilder()->theme($notification->viewBuilder()->theme());
     $email->viewBuilder()->layout($notification->viewBuilder()->layout());
     $email->viewBuilder()->autoLayout($notification->viewBuilder()->autoLayout());
     $email->viewBuilder()->layoutPath($notification->viewBuilder()->layoutPath());
     $email->viewBuilder()->name($notification->viewBuilder()->name());
     $email->viewBuilder()->className($notification->viewBuilder()->className());
     $email->viewBuilder()->options($notification->viewBuilder()->options());
     $email->viewBuilder()->helpers($notification->viewBuilder()->helpers());
     $email->viewVars($notification->viewVars());
     return $email->send();
 }
開發者ID:cvo-technologies,項目名稱:cakephp-notifier,代碼行數:26,代碼來源:EmailTransport.php


注:本文中的Cake\Mailer\Email::viewBuilder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。