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


PHP Mailer::send方法代碼示例

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


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

示例1: handle

 /**
  * Handle the event.
  *
  * @param UnknownPayPalPaymentReceived $event
  */
 public function handle(UnknownPayPalPaymentReceived $event)
 {
     $email = $event->emailAddress;
     $payment = $this->paymentRepository->getById($event->paymentId);
     $this->mailer->send('emails.paypal-donation', ['email' => $email, 'payment' => $payment], function ($m) use($email) {
         $m->to($email);
         $m->cc('trustees@buildbrighton.com');
         $m->subject('Unknown PayPal Payment Received');
     });
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:15,代碼來源:EmailDonorAboutUnknownPayPalPayment.php

示例2: handle

 /**
  * Handle the event.
  *
  * @param MemberGivenTrustedStatus $event
  */
 public function handle(MemberGivenTrustedStatus $event)
 {
     $user = $event->user;
     $this->mailer->send('emails.made-trusted-member', ['user' => $event->user], function ($m) use($user) {
         $m->to($user->email, $user->name)->subject('You have been made a trusted member');
     });
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:12,代碼來源:EmailMemberAboutTrustedStatus.php

示例3: handle

 /**
  * Handle the event.
  *
  * @param  InquiryWasCreated  $event
  * @return void
  */
 public function handle(InquiryWasCreated $event)
 {
     $this->mailer->send('emails.inquiry', ['inquiry' => $event->inquiry], function ($m) use($event) {
         $m->from(config('site.email'), config('site.company'));
         $m->to(config('site.notificationEmail'), config('site.company'))->subject('New Inquiry');
     });
 }
開發者ID:evendev,項目名稱:mcmills,代碼行數:13,代碼來源:EmailInquiryNotification.php

示例4: handle

 /**
  * Handle the event.
  *
  * @param  TaskCreatedEvent  $event
  * @return void
  */
 public function handle(TaskCreatedEvent $event)
 {
     $this->mailer->send('emails.new_task', ['task' => $event->getTask()], function ($m) {
         $m->from('hello@app.com', 'Your Application');
         $m->to('example@email.com', 'destinatario')->subject('Task creato!');
     });
 }
開發者ID:grisoni77,項目名稱:laravel_tutorial,代碼行數:13,代碼來源:TaskCreatedEventListener.php

示例5: 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

示例6: send

 /**
  * Send the given notification.
  *
  * @param  mixed  $notifiable
  * @param  \Illuminate\Notifications\Notification  $notification
  * @return void
  */
 public function send($notifiable, Notification $notification)
 {
     if (!$notifiable->routeNotificationFor('mail')) {
         return;
     }
     $message = $notification->toMail($notifiable);
     if ($message instanceof Mailable) {
         return $message->send($this->mailer);
     }
     $this->mailer->send($message->view, $message->data(), function ($m) use($notifiable, $notification, $message) {
         $recipients = empty($message->to) ? $notifiable->routeNotificationFor('mail') : $message->to;
         if (!empty($message->from)) {
             $m->from($message->from[0], isset($message->from[1]) ? $message->from[1] : null);
         }
         if (is_array($recipients)) {
             $m->bcc($recipients);
         } else {
             $m->to($recipients);
         }
         $m->subject($message->subject ?: Str::title(Str::snake(class_basename($notification), ' ')));
         foreach ($message->attachments as $attachment) {
             $m->attach($attachment['file'], $attachment['options']);
         }
         foreach ($message->rawAttachments as $attachment) {
             $m->attachData($attachment['data'], $attachment['name'], $attachment['options']);
         }
     });
 }
開發者ID:hannesvdvreken,項目名稱:framework,代碼行數:35,代碼來源:MailChannel.php

示例7: handle

 /**
  * Handle the event.
  *
  * @param  ExpenseWasApproved  $event
  * @return void
  */
 public function handle(ExpenseWasApproved $event)
 {
     $user = $event->expense->user;
     $this->mailer->send('emails.expense-approved', ['user' => $event->expense->user, 'expense' => $event->expense], function ($m) use($user) {
         $m->to($user->email, $user->name)->subject('Your expense was approved');
     });
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:13,代碼來源:EmailMemberAboutApprovedExpense.php

示例8: handle

 /**
  * Handle the event.
  *
  * @param  \Apolune\Account\Events\Email\RequestAccepted  $event
  * @return void
  */
 public function handle(Email\RequestAccepted $event)
 {
     list($account, $password) = [$event->account, $event->password];
     $this->mailer->send('theme::_emails.new-email', compact('account', 'password'), function ($message) use($account) {
         $message->to($account->email());
         $message->subject(trans('theme::_emails/new-email.title', ['server' => server()->name()]));
     });
 }
開發者ID:apolune,項目名稱:account,代碼行數:14,代碼來源:SendNewEmailConfirmation.php

示例9: sendEmailForConfirmation

 /**
  * 이메일 인증을 위한 이메일을 전송한다.
  *
  * @param EmailInterface $mail     전송할 이메일 정보
  * @param null|Closure   $callback 이메일 전송할 때 처리할 로직
  *
  * @return void
  */
 public function sendEmailForConfirmation(EmailInterface $mail, $callback = null)
 {
     $this->mailer->send($this->view, compact('mail'), function ($m) use($mail, $callback) {
         $m->to($mail->getAddress());
         if (!is_null($callback)) {
             call_user_func($callback, $m, $mail);
         }
     });
 }
開發者ID:xpressengine,項目名稱:xpressengine,代碼行數:17,代碼來源:EmailBroker.php

示例10: create

 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     $token = str_random(60);
     $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'confirmation_token' => $token, 'password' => bcrypt($data['password'])]);
     $this->mailer->send(['emails.register', 'emails.register-text'], compact('token', 'user'), function ($message) use($user) {
         $message->to($user->email)->subject('Confirmation de votre compte');
     });
     return $user;
 }
開發者ID:emile442,項目名稱:altis-pan,代碼行數:15,代碼來源:Registrar.php

示例11: whenUserEmailChangeWasRequested

 /**
  * @param \Flarum\Events\UserEmailChangeWasRequested $event
  */
 public function whenUserEmailChangeWasRequested(UserEmailChangeWasRequested $event)
 {
     $email = $event->email;
     $data = $this->getEmailData($event->user, $email);
     $this->mailer->send(['text' => 'flarum::emails.confirmEmail'], $data, function (Message $message) use($email) {
         $message->to($email);
         $message->subject('Confirm Your New Email Address');
     });
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:12,代碼來源:EmailConfirmationMailer.php

示例12: sendNewPassword

 public function sendNewPassword(CanResetPassword $user)
 {
     $password = str_random(8);
     $user->password = $password;
     $user->save();
     $this->mailer->send('auth::emails.new_password', compact('user', 'password'), function ($m) use($user) {
         $m->to($user->getEmailForPasswordReset());
     });
 }
開發者ID:laravolt,項目名稱:auth,代碼行數:9,代碼來源:Password.php

示例13: handle

 public function handle(ModuleWasSubmittedForApproval $event)
 {
     $module = $event->module;
     $this->mailer->send('module::emails.module-submitted-notification', compact('module'), function (Message $message) use($module) {
         $message->subject('AsgardCms: New module submitted');
         $message->to('n.widart@gmail.com');
         $message->replyTo($module->user->email);
     });
 }
開發者ID:okao,項目名稱:Website,代碼行數:9,代碼來源:NotifyAdminForNewModule.php

示例14: handle

 /**
  * Handle the event.
  *
  * @param  mixed  $event
  * @return void
  */
 public function handle($event)
 {
     $account = $event->account;
     $account->load('properties');
     $this->mailer->send('theme::_emails.verification', compact('account'), function ($message) use($account) {
         $message->to($account->email());
         $message->subject('Testing');
     });
 }
開發者ID:apolune,項目名稱:account,代碼行數:15,代碼來源:SendVerificationEmail.php

示例15: registerUser

 /**
  * @param array $params
  *
  * @return \App\DataAccess\Eloquent\User
  */
 public function registerUser(array $params)
 {
     $user = $this->user->save($params);
     $this->mailer->send('emails.register', ['user' => $user], function ($m) use($user) {
         /** @var \Illuminate\Mail\Message $m */
         $m->sender('laravel-reference@example.com', 'Laravelリファレンス')->to($user->email, $user->name)->subject('ユーザー登録が完了しました');
     });
     return $user;
 }
開發者ID:laravel-jp-reference,項目名稱:chapter8,代碼行數:14,代碼來源:UserService.php


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