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


PHP Mailer::queue方法代码示例

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


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

示例1: handle

 /**
  * Handle the event.
  *
  * @param \CachetHQ\Cachet\Bus\Events\Incident\IncidentHasReportedEvent $event
  *
  * @return void
  */
 public function handle(IncidentWasReportedEvent $event)
 {
     if (!$event->incident->notify) {
         return false;
     }
     $incident = AutoPresenter::decorate($event->incident);
     $component = AutoPresenter::decorate($event->incident->component);
     // Only send emails for public incidents.
     if ($event->incident->visible === 1) {
         foreach ($this->subscriber->isVerified()->get() as $subscriber) {
             $mail = ['email' => $subscriber->email, 'subject' => 'New incident reported.', 'has_component' => $event->incident->component ? true : false, 'component_name' => $component ? $component->name : null, 'status' => $incident->human_status, 'html_content' => $incident->formattedMessage, 'text_content' => $incident->message, 'token' => $subscriber->token, 'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]), 'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code])];
             $this->mailer->queue(['html' => 'emails.incidents.new-html', 'text' => 'emails.incidents.new-text'], $mail, function (Message $message) use($mail) {
                 $message->to($mail['email'])->subject($mail['subject']);
             });
         }
     }
 }
开发者ID:uwm-appbrewery,项目名称:Cachet,代码行数:24,代码来源:SendIncidentEmailNotificationHandler.php

示例2: sendTo

 /**
  * Convenience function for sending mail
  *
  * @param $email
  * @param $subject
  * @param $view
  * @param array $data
  */
 public function sendTo($email, $subject, $view, $data = array())
 {
     $sender = $this->gatherSenderAddress();
     $this->mailer->queue($view, $data, function ($message) use($email, $subject, $sender) {
         $message->to($email)->from($sender['address'], $sender['name'])->subject($subject);
     });
 }
开发者ID:srlabs,项目名称:groundwork,代码行数:15,代码来源:BaseMailer.php

示例3: handle

 public function handle(ModuleWasSubmittedForApproval $event)
 {
     $module = $event->module;
     $this->mailer->queue('module::emails.thank-you', compact('module'), function (Message $message) use($module) {
         $message->subject('AsgardCms: Module submitted');
         $message->to($module->user->email);
     });
 }
开发者ID:okao,项目名称:Website,代码行数:8,代码来源:SendThankYouEmailToAuthor.php

示例4: handle

 /**
  * Handle the event.
  *
  * @param  BusinessWasFlagged  $event
  * @return void
  */
 public function handle(BusinessWasFlagged $event)
 {
     $data = ['user' => $event->user, 'business' => $event->business];
     $this->mailer->queue('emails.admin.business.flagged', $data, function (Message $message) {
         $message->to(env('APP_EMAIL_SENDER', 'Toilets for Trans Folk'));
         $message->from(env('APP_EMAIL_SENDER', 'TFTF Web App'));
     });
 }
开发者ID:penoonan,项目名称:toilets,代码行数:14,代码来源:BusinessFlaggedNotification.php

示例5: notify

 /**
  * Send notification to subscriber.
  *
  * @param \CachetHQ\Cachet\Models\Component  $component
  * @param \CachetHQ\Cachet\Models\Subscriber $subscriber
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function notify(Component $component, Subscriber $subscriber)
 {
     $component = AutoPresenter::decorate($component);
     $mail = ['subject' => trans('cachet.subscriber.email.component.subject'), 'component_name' => $component->name, 'component_human_status' => $component->human_status];
     $mail['email'] = $subscriber->email;
     $mail['manage_link'] = route('subscribe.manage', ['code' => $subscriber->verify_code]);
     $this->mailer->queue(['html' => 'emails.components.update-html', 'text' => 'emails.components.update-text'], $mail, function (Message $message) use($mail) {
         $message->to($mail['email'])->subject($mail['subject']);
     });
 }
开发者ID:aksalj,项目名称:Cachet,代码行数:18,代码来源:SendComponentUpdateEmailNotificationHandler.php

示例6: create

 public function create(SubmitWebsiteRequest $request)
 {
     $data = $request->all();
     $this->mailer->queue('emails.website-proposal', ['data' => $data], function (Message $message) use($data) {
         $message->to('n.widart@gmail.com');
         $message->replyTo($data['email'], $data['name']);
         $message->subject('AsgardCms: New Website Proposal');
     });
     return response()->json('Thank you for submitting your website! We\'ll get back to your as soon as possible .');
 }
开发者ID:okao,项目名称:Website,代码行数:10,代码来源:SitesController.php

示例7: created

 /**
  * @param Message $message
  */
 public function created(Message $message)
 {
     if (!app()->runningInConsole()) {
         $this->mailer->queue('emails.business.message', ['msg' => $message], function (MailMessage $mail) use($message) {
             if ($message->anonymous) {
                 $mail->from(env('APP_EMAIL_SENDER'), 'Toilets For Transfolk');
             } else {
                 $mail->from($message->user->email, $message->user->name);
             }
             $mail->to($message->business->email, $message->business->name);
         });
     }
 }
开发者ID:penoonan,项目名称:toilets,代码行数:16,代码来源:MessageObserver.php

示例8: handle

 /**
  * Handle the event.
  *
  * @param \CachetHQ\Cachet\Events\IncidentHasReportedEvent $event
  */
 public function handle(IncidentHasReportedEvent $event)
 {
     $data = $this->presenter->decorate($event->incident);
     // Only send emails for public incidents.
     if ($event->incident->visible === 1) {
         foreach ($this->subscriber->all() as $subscriber) {
             $mail = ['email' => $subscriber->email, 'subject' => 'New incident reported.', 'status' => $data->humanStatus, 'htmlContent' => $data->formattedMessage, 'textContent' => $data->message, 'token' => $subscriber->token, 'unsubscribeLink' => route('unsubscribe', ['code' => $subscriber->verify_code]), 'appUrl' => env('APP_URL')];
             $this->mailer->queue(['html' => 'emails.incidents.new-html', 'text' => 'emails.incidents.new-text'], $mail, function (Message $message) use($mail) {
                 $message->to($mail['email'])->subject($mail['subject']);
             });
         }
     }
 }
开发者ID:n0mer,项目名称:Cachet,代码行数:18,代码来源:SendIncidentEmailNotificationHandler.php

示例9: send

 /**
  * Base send method
  *
  * @param            $to
  * @param            $subject
  * @param            $view
  * @param array      $data
  * @param array|null $cc
  * @param array|null $bcc
  *
  * @return mixed
  */
 public function send($to, $subject, $view, $data = [], $cc = [], $bcc = [])
 {
     return $this->mailer->queue($view, $data, function ($m) use($to, $subject, $cc, $bcc) {
         $m->to($to);
         if ($cc) {
             $m->cc($cc);
         }
         if ($bcc) {
             $m->bcc($bcc);
         }
         $m->subject(sprintf("[%s] %s", config('project.name'), $subject));
     });
 }
开发者ID:valdinei,项目名称:rest,代码行数:25,代码来源:Mailer.php

示例10: handle

 /**
  * Handle the event.
  *
  * @param \CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent $event
  *
  * @return void
  */
 public function handle(ComponentWasUpdatedEvent $event)
 {
     $component = AutoPresenter::decorate($event->component);
     $mail = ['subject' => trans('cachet.subscriber.email.component.subject'), 'component_name' => $component->name, 'component_human_status' => $component->human_status];
     foreach (Subscription::isVerifiedForComponent($component->id)->with('subscriber')->get() as $subscription) {
         $subscriber = $subscription->subscriber;
         $mail['email'] = $subscriber->email;
         $mail['unsubscribe_link'] = route('subscribe.unsubscribe', ['code' => $subscriber->verify_code, 'subscription' => $subscription->id]);
         $this->mailer->queue(['html' => 'emails.components.update-html', 'text' => 'emails.components.update-text'], $mail, function (Message $message) use($mail) {
             $message->to($mail['email'])->subject($mail['subject']);
         });
     }
 }
开发者ID:mohitsethi,项目名称:Cachet,代码行数:20,代码来源:SendComponentUpdateEmailNotificationHandler.php

示例11: handle

 /**
  * Handle the event.
  *
  * @param \CachetHQ\Cachet\Events\Incident\IncidentHasReportedEvent $event
  *
  * @return void
  */
 public function handle(IncidentWasReportedEvent $event)
 {
     $incident = $this->presenter->decorate($event->incident);
     $component = $this->presenter->decorate($event->incident->component);
     // Only send emails for public incidents.
     if ($event->incident->visible === 1) {
         foreach ($this->subscriber->all() as $subscriber) {
             $mail = ['email' => $subscriber->email, 'subject' => 'New incident reported.', 'has_component' => $event->incident->component ? true : false, 'component_name' => $component ? $component->name : null, 'status' => $incident->humanStatus, 'html_content' => $incident->formattedMessage, 'text_content' => $incident->message, 'token' => $subscriber->token, 'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]), 'app_url' => env('APP_URL')];
             $this->mailer->queue(['html' => 'emails.incidents.new-html', 'text' => 'emails.incidents.new-text'], $mail, function (Message $message) use($mail) {
                 $message->to($mail['email'])->subject($mail['subject']);
             });
         }
     }
 }
开发者ID:practico,项目名称:Cachet,代码行数:21,代码来源:SendIncidentEmailNotificationHandler.php

示例12: handle

 /**
  * Handle the event.
  *
  * @param \Gitamin\Events\Issue\IssueHasAddedEvent $event
  *
  * @return void
  */
 public function handle(IssueWasAddedEvent $event)
 {
     if (!$event->issue->notify) {
         return false;
     }
     $issue = AutoPresenter::decorate($event->issue);
     $project = AutoPresenter::decorate($event->issue->project);
     // Only send emails for public issues.
     if ($event->issue->visible === 1) {
         foreach ($this->subscriber->all() as $subscriber) {
             $mail = ['email' => $subscriber->email, 'subject' => 'New issue reported.', 'has_project' => $event->issue->project ? true : false, 'project_name' => $project ? $project->name : null, 'status' => $issue->humanStatus, 'html_content' => $issue->formattedMessage, 'text_content' => $issue->message, 'token' => $subscriber->token, 'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code])];
             $this->mailer->queue(['html' => 'emails.issues.new-html', 'text' => 'emails.issues.new-text'], $mail, function (Message $message) use($mail) {
                 $message->to($mail['email'])->subject($mail['subject']);
             });
         }
     }
 }
开发者ID:xiuchanghu,项目名称:Gitamin,代码行数:24,代码来源:SendIssueEmailNotificationHandler.php

示例13: notify

 /**
  * Send notification to subscriber.
  *
  * @param \CachetHQ\Cachet\Bus\Events\IncidentWasReportedEvent $event
  * @param \CachetHQ\Cachet\Models\Subscriber                   $subscriber
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function notify(IncidentWasReportedEvent $event, $subscriber)
 {
     $incident = AutoPresenter::decorate($event->incident);
     $component = AutoPresenter::decorate($event->incident->component);
     $mail = ['email' => $subscriber->email, 'subject' => trans('cachet.subscriber.email.incident.subject', ['status' => $incident->human_status, 'name' => $incident->name]), 'has_component' => $event->incident->component ? true : false, 'component_name' => $component ? $component->name : null, 'name' => $incident->name, 'timestamp' => $incident->created_at_formatted, 'status' => $incident->human_status, 'html_content' => $incident->formattedMessage, 'text_content' => $incident->message, 'token' => $subscriber->token, 'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]), 'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code])];
     $this->mailer->queue(['html' => 'emails.incidents.new-html', 'text' => 'emails.incidents.new-text'], $mail, function (Message $message) use($mail) {
         $message->to($mail['email'])->subject($mail['subject']);
     });
 }
开发者ID:aksalj,项目名称:Cachet,代码行数:17,代码来源:SendIncidentEmailNotificationHandler.php

示例14: emailQueueVerificationLink

 /**
  * Prepare and push a job onto the queue to send the e-mail with the verification token link.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  string  $subject
  * @param  string  $from
  * @param  string  $name
  * @return mixed
  */
 protected function emailQueueVerificationLink(AuthenticatableContract $user, $subject, $from = null, $name = null)
 {
     return $this->mailer->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,代码行数:20,代码来源:UserVerification.php

示例15: addToQueue

 /**
  * add mail to queue
  * @param $view
  * @param $data
  * @param $callback
  */
 protected function addToQueue($view, $data, $callback)
 {
     $this->mailer->queue($view, $data, $callback);
 }
开发者ID:younginnovations,项目名称:aidstream,代码行数:10,代码来源:EmailQueue.php


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