当前位置: 首页>>代码示例>>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;未经允许,请勿转载。