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


PHP Mail::queue方法代码示例

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


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

示例1: confirm_change_class

 public function confirm_change_class(Request $request)
 {
     $registerId = $request->registerId;
     $classId = $request->classId;
     $register = Register::find($registerId);
     $oldClass = $register->studyClass;
     $class_lession_ids = $oldClass->classLessons->pluck('id');
     $attendances = $register->attendances()->whereIn('class_lesson_id', $class_lession_ids)->get();
     $register->class_id = $classId;
     $register->save();
     $newClass = StudyClass::find($classId);
     $new_class_lession_ids = $newClass->classLessons->pluck('id');
     $index = 0;
     foreach ($attendances as $attendance) {
         $attendance->class_lesson_id = $new_class_lession_ids[$index];
         $attendance->save();
         $index += 1;
     }
     $data['newClass'] = $newClass;
     $data['oldClass'] = $oldClass;
     $user = $register->user;
     $data['user'] = $user;
     $subject = "Xác nhận đã đổi thành công từ lớp {$oldClass->name} sang lớp {$newClass->name}";
     $emailcc = ['colorme.idea@gmail.com'];
     Mail::queue('emails.confirm_change_class', $data, function ($m) use($user, $subject, $emailcc) {
         $m->from('no-reply@colorme.vn', 'Color Me');
         $m->to($user['email'], $user['name'])->bcc($emailcc)->subject($subject);
     });
     $request->session()->flash('change_class_message', 'Bạn đã đổi thành công sang lớp ' . $newClass->name);
     return redirect('manage/registerlist');
 }
开发者ID:Kaelcao,项目名称:colormev2,代码行数:31,代码来源:ManageStudentController.php

示例2: __construct

 /**
  * Create a new event instance.
  *
  * @return void
  */
 public function __construct($EcNa, $typ, $eml, $pass, $nomresp, $fix, $port, $adres, $ville, $pays)
 {
     $this->ecoleNom = $EcNa;
     $this->type = $typ;
     $this->email = $eml;
     $this->password = $pass;
     $this->nomResponsable = $nomresp;
     $this->fix = $fix;
     $this->portab = $port;
     $this->adresse = $adres;
     $this->ville = $ville;
     $this->pays = $pays;
     $user = new User();
     $user->name = $this->ecoleNom;
     $user->type = $this->type;
     $user->email = $this->email;
     $user->password = \Hash::make($this->password);
     $user->nom_responsable = $this->nomResponsable;
     $user->tel_fixe = $this->fix;
     $user->tel_portable = $this->portab;
     $user->adresse = $this->adresse;
     $user->ville = $this->ville;
     $user->pays = $this->pays;
     $user->save();
     if ($user) {
         $info = ['nom_resp' => $this->nomResponsable, 'nom_ecole' => $this->ecoleNom, 'email' => $this->email, 'pass' => $this->password];
         Mail::queue('emails.school', $info, function ($message) {
             $message->to($this->email, 'ok')->from('creche@gmail.com')->subject('Bienvenue  !');
         });
     }
 }
开发者ID:khaleader,项目名称:creche,代码行数:36,代码来源:SchoolSendEmailEvent.php

示例3: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $notification = $this->notification->where('slug', $this->argument('notification'))->first();
     if (!$notification) {
         $this->error('Invalid notification provided.');
         return 1;
     }
     $users = $notification->subscribers;
     if (!count($users)) {
         $this->error('No subscribers to send to!');
         return 1;
     }
     if (method_exists($this, $notification->slug)) {
         $users = $this->{$notification->slug}($users);
     }
     if ($this->option('pretend')) {
         $this->info('Notification ' . $notification->name . ' would be sent to the following subscribers:');
         foreach ($users as $user) {
             $this->line($user->name . ' <' . $user->email . '>');
         }
         return 0;
     }
     foreach ($users as $user) {
         Mail::queue('emails.notifications.' . $notification->template, ['user' => $user], function ($message) use($user, $notification) {
             $message->to($user->email, $user->name);
             $message->subject($notification->subject);
         });
         $this->info('Queued notification for ' . $user->name . ' <' . $user->email . '>');
     }
     return 0;
 }
开发者ID:Cheddam,项目名称:health,代码行数:36,代码来源:SendNotification.php

示例4: handle

 /**
  * Handle the event.
  *
  * @param  Suscribir  $event
  * @return void
  */
 public function handle(Suscribir $event)
 {
     $email = $event->userdata;
     Mail::queue('emails.welcome', ['confirmationcode' => $email->confirmation_code], function ($message) use($email) {
         $message->to($email->email, $email->name)->subject('Bienvenido a IntroMercado ' . time());
     });
 }
开发者ID:gerardo15,项目名称:4sale,代码行数:13,代码来源:NuevoUsuarioCreado.php

示例5: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     Mail::queue('emails.ping', [], function ($message) {
         $message->from('welcome@iheartreading.co', 'I Heart Reading');
         $message->to('test@email.com');
     });
 }
开发者ID:jrm2k6,项目名称:i-heart-reading,代码行数:12,代码来源:SendTestEmail.php

示例6: handle

 /**
  * Handle the event.
  *
  * @param  OrderShippedOn  $event
  * @return void
  */
 public function handle(OrderShippedOn $event)
 {
     $data = ['expectedDate' => $event->order->expected_delivery_on];
     Mail::queue('emails.order.shipped', $data, function ($message) use($event) {
         $message->to($event->order->user->email, $event->order->user->getName())->subject('Order was shipped');
     });
 }
开发者ID:Tisho84,项目名称:laravel-work,代码行数:13,代码来源:OrderShippedOnHandler.php

示例7: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(EmailConfirmationRepository $tokens)
 {
     $tokens->store($this->email, $this->token);
     Mail::queue('emails.auth.email_confirmation', ['email' => $this->email, 'token' => $this->token], function ($m) {
         $m->to($this->email)->subject('Confirmation');
     });
 }
开发者ID:adiachenko,项目名称:rabbits,代码行数:12,代码来源:SendSignupEmail.php

示例8: handle

 /**
  * Handle the event.
  *
  * @param  OrderWasDelivered  $event
  * @return void
  */
 public function handle(OrderWasDelivered $event)
 {
     $data = ['city' => $event->order->address->city, 'date' => getCarbonDate(Carbon::now()), 'address' => $event->order->address->street];
     Mail::queue('emails.order.delivered', $data, function ($message) use($event) {
         $message->to($event->order->user->email, $event->order->user->getName())->subject('Order was delivered');
     });
 }
开发者ID:Tisho84,项目名称:laravel-work,代码行数:13,代码来源:OrderWasDeliveredClientHandler.php

示例9: Form

 function Form($fields)
 {
     $data = Input::all();
     $email_path = null;
     if ($fields == 3) {
         $rules = array('Name' => 'required', 'Phone' => 'required|max:10', 'Email' => 'required|email');
         $email_path = 'emails.home';
     } elseif ($fields == 5) {
         $rules = array('Name' => 'required', 'Company_Name' => 'required', 'Phone' => 'required|max:10', 'Email' => 'required|email', 'Address' => 'required|max:255');
         $email_path = 'emails.transporters';
     } elseif ($fields == 4) {
         $rules = array('Name' => 'required', 'Phone' => 'required|max:10', 'Email' => 'required|email', 'Message' => 'required|max:1024');
         $email_path = 'emails.contact';
     } elseif ($fields == 6) {
         $rules = array('Name' => 'required', 'Phone' => 'required|max:10', 'Email' => 'required|email', 'Address' => 'required|max:1024');
         $email_path = 'emails.truckowners';
     }
     $validator = Validator::make($data, $rules);
     $errors = $validator->errors();
     $errors = json_decode($errors);
     if ($validator->fails()) {
         return Response::json(array('errors' => $errors), 422);
         // 400 being the HTTP code for an invalid request.
     }
     //        $data   =   array_add($data,'Sent_at',Carbon::now()->diffForHumans());
     Mail::queue($email_path, $data, function ($msg) {
         $msg->to('info@truckjee.com', Input::get('Name'))->subject('New message from TruckJee Website');
     });
     Mail::queue('emails.thankyou', $data, function ($msg) {
         $msg->to(Input::get('Email'), Input::get('Name'))->subject('TruckJee Contact');
     });
     return Response::json(array('success' => 'Thank you for your interest. We would get back to you shortly.'), 200);
 }
开发者ID:younus93,项目名称:multilingual-website,代码行数:33,代码来源:WebsiteController.php

示例10: send

 public function send($user)
 {
     $code = $user->getResetPasswordCode();
     Mail::queue(array('laravel-sentry-backend::emails.password_reset_html', 'laravel-sentry-backend::emails.password_reset_txt'), compact('user', 'code'), function ($message) use($user) {
         $message->to($user->email)->subject('Your password reset link');
     });
 }
开发者ID:djordje,项目名称:laravel-sentry-backend,代码行数:7,代码来源:PasswordReset.php

示例11: handle

 /**
  * Handle the event.
  *
  * @param  OrderWasProcessed  $event
  * @return void
  */
 public function handle(OrderWasProcessed $event)
 {
     $data = ['shipped' => $event->order->shipped_on];
     Mail::queue('emails.order.processed', $data, function ($message) use($event) {
         $message->to($event->order->user->email, $event->order->user->getName())->subject('Order was processed');
     });
 }
开发者ID:Tisho84,项目名称:laravel-work,代码行数:13,代码来源:OrderWasProcessedHandler.php

示例12: handle

 /**
  * Handle the event.
  *
  * @param  OrderWasPlaced  $event
  * @return void
  */
 public function handle(OrderWasPlaced $event)
 {
     $data = ['amount' => $event->order->getAmount(), 'date' => $event->order->created_at->format('Y-m-d')];
     Mail::queue('emails.order.placed', $data, function ($message) use($event) {
         $message->to($event->user->email, $event->user->getName())->subject('Order was placed');
     });
 }
开发者ID:Tisho84,项目名称:laravel-work,代码行数:13,代码来源:OrderClientConfirmation.php

示例13: __construct

 /**
  * Create a new event instance.
  *
  * @param $c_id
  * @param $nom_responsable
  * @param $nom_enfant
  * @param $date_inscription
  * @param $date_prochain_paiement
  * @param $pseudo_compte_famille
  * @param $responsable
  * @param $mot_de_pass_temporaire_compte_famille
  */
 public function __construct($c_id, $nom_responsable, $nom_enfant, $date_inscription, $date_prochain_paiement, $pseudo_compte_famille, $responsable, $mot_de_pass_temporaire_compte_famille)
 {
     $this->child_id = $c_id;
     $this->nom_responsable = $nom_responsable;
     $this->nom_enfant = $nom_enfant;
     $this->date_inscription = $date_inscription;
     $this->date_prochain_paiement = $date_prochain_paiement;
     $this->pseudo_compte_famille = $pseudo_compte_famille;
     $this->responsable = $responsable;
     $this->mot_de_pass_temporaire_compte_famille = $mot_de_pass_temporaire_compte_famille;
     $user = new User();
     $user->nom_responsable = $this->nom_responsable;
     $user->name = $this->nom_responsable;
     $user->type = 'famille';
     $user->email = $this->pseudo_compte_famille;
     $user->password = \Hash::make($this->mot_de_pass_temporaire_compte_famille);
     if ($this->responsable == 1) {
         $user->sexe = 'homme';
     } else {
         $user->sexe = 'femme';
     }
     $user->save();
     if ($user) {
         $child = Child::findOrFail($this->child_id);
         $child->f_id = $user->id;
         $child->save();
         $bill = Bill::where('child_id', $this->child_id)->first();
         $bill->f_id = $user->id;
         $bill->save();
         $info = ['responsable' => $this->nom_responsable, 'nom_enfant' => $this->nom_enfant, 'date_inscription' => $this->date_inscription, 'date_pro_paim' => $this->date_prochain_paiement, 'pseudo_email' => $this->pseudo_compte_famille, 'respons' => $this->responsable, 'pass' => $this->mot_de_pass_temporaire_compte_famille];
         Mail::queue('emails.test', $info, function ($message) {
             $message->to($this->pseudo_compte_famille, 'ok')->from('creche@gmail.com')->subject('Bienvenue  !');
         });
     }
 }
开发者ID:khaleader,项目名称:creche,代码行数:47,代码来源:SendEmailToRespAfterRegistrationEvent.php

示例14: sendNotification

 /**
  * Send email notifications from the action owner to other involved users
  * @param string $template
  * @param array $data
  * @param object $ticket
  * @param object $notification_owner
  */
 public function sendNotification($template, $data, $ticket, $notification_owner, $subject, $type)
 {
     if (config('ticketit.queue_emails') == 'yes') {
         Mail::queue($template, $data, function ($m) use($ticket, $notification_owner, $subject, $type) {
             if ($type != 'agent') {
                 if ($ticket->user->email != $notification_owner->email) {
                     $m->to($ticket->user->email, $ticket->user->name);
                 }
                 if ($ticket->agent->email != $notification_owner->email) {
                     $m->to($ticket->agent->email, $ticket->agent->name);
                 }
             } else {
                 $m->to($ticket->agent->email, $ticket->agent->name);
             }
             $m->from($notification_owner->email, $notification_owner->name);
             $m->subject($subject);
         });
     } else {
         Mail::send($template, $data, function ($m) use($ticket, $notification_owner, $subject, $type) {
             if ($type != 'agent') {
                 if ($ticket->user->email != $notification_owner->email) {
                     $m->to($ticket->user->email, $ticket->user->name);
                 }
                 if ($ticket->agent->email != $notification_owner->email) {
                     $m->to($ticket->agent->email, $ticket->agent->name);
                 }
             } else {
                 $m->to($ticket->agent->email, $ticket->agent->name);
             }
             $m->from($notification_owner->email, $notification_owner->name);
             $m->subject($subject);
         });
     }
 }
开发者ID:jackton,项目名称:ticketit,代码行数:41,代码来源:NotificationsController.php

示例15: queueSendTemplate

 public static function queueSendTemplate($path, $params, $locale = null)
 {
     if (!isset($params[self::EMAIL_FROM])) {
         $params[self::EMAIL_FROM] = appEmail();
     }
     if (!isset($params[self::EMAIL_FROM_NAME])) {
         $params[self::EMAIL_FROM_NAME] = appName();
     }
     if (!isset($params[self::EMAIL_SUBJECT])) {
         $params[self::EMAIL_SUBJECT] = trans('label.message_from_') . appName();
     }
     if (!isset($params[self::EMAIL_TO])) {
         return false;
     }
     if (!empty($locale)) {
         $params['site_locale'] = $locale;
     }
     $locale = $params['site_locale'];
     try {
         Mail::queue('emails.' . $path . '.' . $locale, $params, function ($message) use($params) {
             $message->from($params[MailHelper::EMAIL_FROM], $params[MailHelper::EMAIL_FROM_NAME]);
             $message->subject($params[MailHelper::EMAIL_SUBJECT]);
             if (isset($params[MailHelper::EMAIL_TO_NAME])) {
                 $message->to($params[MailHelper::EMAIL_TO]);
             } else {
                 $message->to($params[MailHelper::EMAIL_TO], $params[MailHelper::EMAIL_TO_NAME]);
             }
         });
         return count(Mail::failures()) > 0;
     } catch (\Exception $ex) {
         return false;
     }
 }
开发者ID:linhntaim,项目名称:katniss,代码行数:33,代码来源:MailHelper.php


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