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


PHP Mailer::queueOn方法代碼示例

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


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

示例1: emailQueueOnVerificationLink

 /**
  * Prepare and push a job onto the given queue to send the e-mail with the verification token link.
  *
  * @param  string  $queue
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  string  $subject
  * @param  string  $from
  * @param  string  $name
  * @return mixed
  */
 protected function emailQueueOnVerificationLink($queue, AuthenticatableContract $user, $subject, $from = null, $name = null)
 {
     return $this->mailer->queueOn($queue, $this->emailView, compact('user'), function ($m) use($user, $subject, $from, $name) {
         if (!empty($from)) {
             $m->from($from, $name);
         }
         $m->to($user->email);
         $m->subject(is_null($subject) ? trans('laravel-user-verification::user-verification.verification_email_subject') : $subject);
         event(new VerificationEmailSent($user));
     });
 }
開發者ID:jrean,項目名稱:laravel-user-verification,代碼行數:21,代碼來源:UserVerification.php

示例2: send

 /**
  * send email
  *
  * @param bool $queue
  * @return bool
  */
 public final function send($queue = true)
 {
     //php cannot 'use' this variables yet
     $name = $this->name;
     $email = $this->email;
     $subject = $this->subject;
     $attachments = $this->attachments;
     //data
     $data = array_merge($this->defaultData, $this->data);
     //queue email
     if ($queue) {
         $this->mailer->queueOn('email', $this->view, $data, function ($message) use($name, $email, $subject, $attachments) {
             //set recipient
             $message->to($email, $name);
             //set subject
             $message->subject($subject);
             //set attachments
             foreach ($attachments as $attachment) {
                 $message->attach($attachment);
             }
         });
     } else {
         $this->mailer->send($this->view, $data, function ($message) use($name, $email, $subject, $attachments) {
             //set recipient
             $message->to($email, $name);
             //set subject
             $message->subject($subject);
             //set attachments
             foreach ($attachments as $attachment) {
                 $message->attach($attachment);
             }
         });
     }
     //make sure to clear out recipient info, so we don't accidentally send multiple times to same person
     $this->name = null;
     $this->email = null;
 }
開發者ID:browner12,項目名稱:mailer,代碼行數:43,代碼來源:Mailer.php

示例3: queueOn

 /**
  * @param $queue
  * @param $view
  * @param $data
  *
  * @return mixed
  */
 public function queueOn($queue, $view, $data)
 {
     return $this->mailer->queueOn($queue, $view, $data, $this->callback($data));
 }
開發者ID:draperstudio,項目名稱:laravel-mail,代碼行數:11,代碼來源:Mailer.php


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