當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。