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


PHP Mailer::failures方法代碼示例

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


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

示例1: handle

 /**
  * Handle the command.
  *
  * @param ContactFormBuilder $builder
  * @param MessageBag         $messages
  * @param Mailer             $mailer
  */
 public function handle(ContactFormBuilder $builder, MessageBag $messages, Mailer $mailer)
 {
     // Validation failed!
     if ($builder->hasFormErrors()) {
         return;
     }
     // Delegate these for now.
     $view = $this->dispatch(new GetMessageView($builder));
     $data = $this->dispatch(new GetMessageData($builder));
     // Build the message object.
     $message = function (Message $message) use($builder) {
         $this->dispatch(new BuildMessage($message, $builder));
     };
     // Send the email.
     $mailer->send($view, $data, $message);
     // If there are any failures, report.
     if (count($mailer->failures()) > 0) {
         $messages->error($builder->getFormOption('error_message', 'anomaly.plugin.contact::error.send_message'));
     } else {
         // Otherwise, show success.
         $messages->success($builder->getFormOption('success_message', 'anomaly.plugin.contact::success.send_message'));
     }
     // Clear the form!
     $builder->resetForm();
 }
開發者ID:anomalylabs,項目名稱:contact-plugin,代碼行數:32,代碼來源:ContactFormHandler.php

示例2: handle

 /**
  * Handle the command.
  *
  * @param Mailer     $mailer
  * @param Repository $config
  * @return bool
  */
 public function handle(Mailer $mailer, Repository $config)
 {
     $path = $this->dispatch(new GetResetPasswordPath($this->user, $this->redirect));
     $mailer->send('anomaly.module.users::message/reset', compact('user', 'path'), function (Message $message) use($config) {
         $message->subject('Reset your password')->to($this->user->getEmail(), $this->user->getDisplayName())->from($config->get('mail.from.address', 'noreply@localhost'));
     });
     return empty($mailer->failures());
 }
開發者ID:jacksun101,項目名稱:users-module,代碼行數:15,代碼來源:SendResetEmail.php

示例3: sendMail

 /**
  * Send a simple email
  *
  * For more complex emails you might write another method
  *
  * @throws MailException Throws an exception containing further information as message
  * @return void
  */
 public function sendMail()
 {
     try {
         $this->mail->send($this->view, $this->data, function ($message) {
             $message->from($this->from['address'], $this->from['name']);
             $message->to($this->to['address'], $this->to['name'])->subject($this->subject);
         });
         if ($this->mail->failures() != array()) {
             throw new MailException($this->mailErrorMessage);
         }
     } catch (Swift_TransportException $e) {
         $this->handleTransportExceptions($e);
     }
 }
開發者ID:LaraGit,項目名稱:larapress,代碼行數:22,代碼來源:Narrator.php

示例4: failures

 /**
  * Get the array of failed recipients.
  *
  * @return array 
  * @static 
  */
 public static function failures()
 {
     return \Illuminate\Mail\Mailer::failures();
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:10,代碼來源:_ide_helper.php

示例5: failures

 /**
  * Get the array of failed recipients.
  *
  *
  */
 public function failures()
 {
     return $this->mailer->failures();
 }
開發者ID:jaffle-be,項目名稱:framework,代碼行數:9,代碼來源:ThemeMailer.php


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