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


PHP Mail\Mailer類代碼示例

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


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

示例1: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $data = ['title' => 'ChickenElectric-Xác nhận người dùng.', 'intro' => 'Cảm ơn bạn vì đã đăng ký làm thành viên của ChickenElectric. Chúng tôi sẽ gửi tới bạn các thông tin mới nhất về các bài viết. Để active tài khoản hãy truy cập vào đường link sau.', 'register_token' => $this->_user->register_token];
     $mailer->send('email.auth.verify', $data, function ($message) {
         $message->to($this->_user->email, 'doankhoi')->subject('ChickenElectric');
     });
 }
開發者ID:doankhoi,項目名稱:Application,代碼行數:12,代碼來源:SendMail.php

示例2: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $data = ['title' => $this->attempt->user->name . ' invited you to attempt the ' . $this->attempt->challenge->title . ' challenge.', 'name' => $this->user->name, 'email' => $this->user->email, 'content' => null, 'url' => 'https://gamechalleng.es/notifications', 'url_text' => 'View Notifications'];
     $mailer->send('emails.transactional', $data, function ($m) use($data) {
         $m->to($data['email'], $data['name'])->subject($data['title']);
     });
 }
開發者ID:BrantWladichuk,項目名稱:gamechalleng.es,代碼行數:12,代碼來源:SendUserAttemptInviteEmail.php

示例3: handle

 /**
  * Execute the job.
  *
  * @param  Mailer $mailer
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     echo 'Sending email.' . PHP_EOL;
     if ($this->attempts() > 1) {
         $this->delete();
     }
     $users = $this->getUsers($this->dir . '/userlist.xlsx');
     $html = file_get_contents($this->dir . '/email.html');
     foreach ($users as $index => $user) {
         $index++;
         if (!filter_var($user, FILTER_VALIDATE_EMAIL)) {
             continue;
         }
         $mailer->send('laravel-sender::email.html', ['html' => $html], function ($m) use($user) {
             $m->from($this->from, $this->fromTitle);
             $m->to($user, null)->subject($this->title);
         });
         var_dump($user);
         if ($index % 10 === 0) {
             sleep(5);
         }
     }
     /*
      */
     echo 'end.' . PHP_EOL;
     $this->delete();
 }
開發者ID:cawakharkov,項目名稱:laravel-sender,代碼行數:33,代碼來源:SendEmail.php

示例4: handle

 /**
  * Execute the job.
  *
  * @param Mailer $mailer
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.verify', [], function ($message) {
         $message->from(env('MAIL_FROM'), 'Easymanage.in');
         $message->to($this->emailAddress)->subject('Please Verify Your Easymanage.in Account');
     });
 }
開發者ID:suchayj,項目名稱:easymanage,代碼行數:13,代碼來源:SendVerificationEmail.php

示例5: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $teachers = $this->teachers;
     foreach ($teachers as $teacher) {
         $message = new TeacherMessage();
         $message->sender_id = $this->sender_id;
         $message->email = $this->email;
         $message->sms = $this->sms;
         $message->teacher_id = $teacher->id;
         $data = ['content' => $this->email];
         $attachments = $this->attachments;
         if ($this->email) {
             $mailer->send('teachers::emails.message', $data, function ($m) use($teacher, $attachments) {
                 $m->to($teacher->email, $teacher->name)->from(config('teachers.from_email'))->subject("subject");
                 if (!empty($attachments)) {
                     foreach ($attachments as $a) {
                         $m->attach($a);
                     }
                 }
             });
             $message->email_sent = 1;
         }
         if ($this->sms) {
             $sms = new SmsGateway($this->sms, [$teacher->mobile]);
             $result = $sms->send();
             if ($result->getPushMessageResult()->PushMessageResult == 1) {
                 $message->sms_sent = 1;
             }
         }
         $message->save();
     }
     event(new TeachersMessagesQueueFinished());
 }
開發者ID:hisambahaa,項目名稱:DARES,代碼行數:38,代碼來源:SendTeachersMessage.php

示例6: handle

 /**
  * Handler
  *
  * @param \Illuminate\Contracts\Mail\Mailer $mailer
  * @param \Illuminate\Contracts\View\Factory $view
  * @param \Illuminate\Contracts\Validation\Factory $validator
  * @throws \Exception
  * @return void
  */
 public function handle(Mailer $mailer, Factory $view, Validator $validator)
 {
     $queue = $this->messageQueue;
     $queue->status = 'in_processes';
     $queue->save();
     $queue->load('event', 'event.template');
     $parameters = array_merge_recursive($queue->event->template->parameters, $queue->event->parameters, $queue->parameters);
     $messageParameters = array_dot($this->getMessageParameters($validator, $parameters['message']));
     $renderView = $queue->event->template->getRender($parameters['view']);
     $mailer->send('message-sender::providers.plain', ['content' => $renderView], function ($message) use($parameters, $messageParameters) {
         $message->from($messageParameters['from.address'], $messageParameters['from.name']);
         $message->to($messageParameters['to.address'], $messageParameters['from.name']);
         $message->subject($parameters['provider']['subject']);
         if (isset($parameters['provider']['headers'])) {
             $mailHeaders = $message->getSwiftMessage()->getHeaders();
             foreach ($parameters['provider']['headers'] as $header) {
                 $mailHeaders->addTextHeader($header['name'], $header['value']);
             }
         }
     });
     if (count($mailer->failures()) > 0) {
         throw new \Exception('Mail send failed.');
     } else {
         $queue->status = 'sent';
         $queue->save();
     }
 }
開發者ID:malezha,項目名稱:message-sender,代碼行數:36,代碼來源:EmailProvider.php

示例7: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.invite', ['email' => $this->auth_user_email, 'name' => $this->auth_user_name], function ($message) {
         $message->from($this->auth_user_email, $this->auth_user_name);
         $message->to($this->email)->subject('Invite to join Invite');
     });
 }
開發者ID:vishnu-b,項目名稱:invite,代碼行數:12,代碼來源:SendInviteEmail.php

示例8: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $this->inscription->load('colloque');
     $annexes = $this->inscription->colloque->annexe;
     // Generate annexes if any
     if (empty($this->inscription->documents) && !empty($annexes)) {
         $this->generator->setInscription($this->inscription)->generate($annexes);
     }
     $date = \Carbon\Carbon::now()->formatLocalized('%d %B %Y');
     $title = 'Votre inscription sur publications-droit.ch';
     $logo = 'facdroit.png';
     $user = $this->inscription->user;
     $annexes = $this->inscription->documents;
     $data = ['title' => $title, 'logo' => $logo, 'concerne' => 'Inscription', 'annexes' => $this->inscription->colloque->annexe, 'inscription' => $this->inscription, 'date' => $date];
     $mailer->send('emails.colloque.confirmation', $data, function ($message) use($user, $annexes) {
         $email = $this->email ? $this->email : $user->email;
         $message->to($email, $user->name)->subject('Confirmation d\'inscription');
         if (!empty($annexes)) {
             foreach ($annexes as $annexe) {
                 $message->attach($annexe['file'], array('as' => $annexe['name'], 'mime' => 'application/pdf'));
             }
         }
     });
     $this->inscription->send_at = date('Y-m-d');
     $this->inscription->save();
 }
開發者ID:abada,項目名稱:webshop,代碼行數:31,代碼來源:SendConfirmationInscriptionEmail.php

示例9: handle

 /**
  * Execute the job.
  *
  * @param  Mailer  $mailer
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $data = ['title' => trans('front/verify.email-title'), 'intro' => trans('front/verify.email-intro'), 'link' => trans('front/verify.email-link'), 'confirmation_code' => $this->user->confirmation_code];
     $mailer->send('emails.auth.verify', $data, function ($message) {
         $message->to($this->user->email, $this->user->username)->subject(trans('front/verify.email-title'));
     });
 }
開發者ID:jhuhandha,項目名稱:lblog,代碼行數:13,代碼來源:SendMail.php

示例10: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.reminder', ['user' => $this->user], function ($m) {
         //
     });
     //$this->user->reminders()->create(...);
 }
開發者ID:leloulight,項目名稱:laravel_latest,代碼行數:12,代碼來源:SendReminderEmail.php

示例11: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $data = ['title' => trans('front/verify.ReviewEmail'), 'intro' => trans('front/verify.email-intro'), 'link' => trans('front/verify.email-link'), 'confirmation_code' => $this->reviewU->confirmation_rev_code];
     $mailer->send('emails.auth.VerifyReview', $data, function ($message) {
         $message->to($this->reviewU->email_reviewer, $this->reviewU->nombre_reviewer)->subject("Review Verify iWaNaTrip.com");
     });
 }
開發者ID:adrianicn,項目名稱:IguanaTrip,代碼行數:12,代碼來源:VerifyReview.php

示例12: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $data = ['title' => "Invitación iWaNaTrip.com", 'nombrede' => $this->invitacion->invitacion_de, 'nombrepara' => $this->invitacion->invitacion_para];
     $mailer->send('emails.auth.inviteFriend', $data, function ($message) {
         $message->to($this->invitacion->correo, $this->invitacion->invitacion_para)->subject("Invitación iWaNaTrip.com");
     });
 }
開發者ID:adrianicn,項目名稱:IguanaTrip,代碼行數:12,代碼來源:InviteFriendsMail.php

示例13: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.mailer', ['user' => $this->user], function ($m) {
         $m->from('jiacai.ding@shinsoft.net');
         $m->to('dingjc89@126.com');
     });
 }
開發者ID:dingjc89,項目名稱:laravel,代碼行數:12,代碼來源:SendReminderEmail.php

示例14: handle

 /**
  * Execute the job.
  *
  * @param  Mailer  $mailer
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->raw('You have received a new purchase of ' . $this->receipt->product->credits . ' credits for ' . $this->receipt->price, function ($message) {
         $message->from('billing@whatscarrier.com', 'Whatscarrier');
         $message->subject('You have received new purchase')->to('mohd.sulaiman@sudirman.info');
     });
 }
開發者ID:natsu90,項目名稱:whatscarrier-api,代碼行數:13,代碼來源:SendPurchaseEmail.php

示例15: handle

 /**
  * Handle the event.
  *
  * @param SubscriptionPayment\FailedInsufficientFunds $event
  */
 public function handle(SubscriptionPayment\FailedInsufficientFunds $event)
 {
     $user = $this->userRepository->getById($event->userId);
     $this->mailer->send('emails.sub-payment-failed', ['user' => $user], function ($m) use($user) {
         $m->to($user->email, $user->name)->subject('Your subscription payment failed');
     });
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:12,代碼來源:EmailMemberAboutFailedSubscriptionPayment.php


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