当前位置: 首页>>代码示例>>PHP>>正文


PHP Email::helpers方法代码示例

本文整理汇总了PHP中Cake\Network\Email\Email::helpers方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::helpers方法的具体用法?PHP Email::helpers怎么用?PHP Email::helpers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Network\Email\Email的用法示例。


在下文中一共展示了Email::helpers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendResetEmail

 /**
  * Sends reset email
  *
  * @param entity $user User entity.
  * 
  * @return void
  */
 public function sendResetEmail($user)
 {
     $reset_key = uniqid();
     $user->{Configure::read('Lil.passwordResetField')} = $reset_key;
     if ($this->save($user)) {
         $email = new Email('default');
         $email->from([Configure::read('Lil.from.email') => Configure::read('Lil.from.name')]);
         $email->to($user->{Configure::read('Lil.userEmailField')});
         $email->subject(__d('lil', 'Password Reset'));
         $email->template('Lil.reset');
         $email->emailFormat('text');
         $email->viewVars(['reset_key' => $reset_key]);
         $email->helpers(['Html']);
         return $email->send();
     }
     return false;
 }
开发者ID:malamalca,项目名称:lil,代码行数:24,代码来源:UsersTable.php

示例2: sendunpaid

 public function sendunpaid($sendto)
 {
     $this->loadModel('Payrolls');
     $unpaid = $this->Payrolls->find()->contain(['Shows', 'Users'])->select(['id', 'date_worked', 'start_time', 'end_time', 'worked', 'is_paid', 'notes', 'showname' => 'Shows.name', 'fullname' => 'concat(Users.first, " ", Users.last)', 'activeshow' => 'Shows.is_active', 'Shows.end_date'])->where(['is_paid' => 0])->where(['Shows.is_active' => 1])->order(['Users.last' => 'ASC', 'Users.first' => 'ASC', 'Shows.end_date' => 'DESC', 'date_worked' => 'DESC', 'start_time' => 'DESC']);
     $datatable = [];
     $lastuser = "";
     $subtotal = 0;
     foreach ($unpaid as $item) {
         if ($item->fullname != $lastuser) {
             if ($subtotal > 0) {
                 $datatable[] = [$lastuser, '', 'Subtotal', '', '', '', number_format($subtotal, 2)];
                 $subtotal = 0;
             }
             $lastuser = $item->fullname;
         }
         $subtotal = $subtotal + $item->worked;
         $datatable[] = [$item->fullname, $item->showname, $item->notes, $item->date_worked->i18nFormat('YYYY-MM-dd', 'UTC'), $item->start_time->i18nFormat('H:mm', 'UTC'), $item->end_time->i18nFormat('H:mm', 'UTC'), number_format($item->worked, 2)];
     }
     if ($subtotal > 0) {
         $datatable[] = [$lastuser, '', 'Subtotal', '', '', '', number_format($subtotal, 2)];
     }
     $headers = ['User Name', 'Show Name', 'Notes', 'Date Worked', 'Start Time', 'End Time', 'Hours Worked'];
     $email = new Email();
     $email->transport('default');
     $email->helpers(['Html', 'Gourmet/Email.Email']);
     $email->emailFormat('both');
     $email->to($sendto);
     $email->subject('Unpaid Hours - ' . date('Y-m-d'));
     $email->from('tdtracx@tdtrac.com');
     $email->template('unpaid');
     $email->viewVars(['headers' => $headers, 'tabledata' => $datatable]);
     $email->send();
     $this->verbose('  E-Mail Sent.');
 }
开发者ID:jtsage,项目名称:TDTracX,代码行数:34,代码来源:TdtracShell.php


注:本文中的Cake\Network\Email\Email::helpers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。