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


PHP Mailer::send方法代码示例

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


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

示例1: send

 /**
  * Send a confirmation email to the user to verify his email address
  *
  * @param \Lio\Accounts\User $user
  */
 public function send(User $user)
 {
     $this->mailer->send($this->view, ['confirmationCode' => $user->confirmation_code], function (Message $message) use($user) {
         $message->to($user->email);
         $message->subject('Verify your email address for your Laravel.io account');
     });
 }
开发者ID:ahkmunna,项目名称:laravel.io,代码行数:12,代码来源:SendConfirmationEmail.php

示例2: notify

 public function notify(RegistrableInterface $admin)
 {
     $password = $admin->getRegistrationPassword();
     $this->mailer->send('emails.cms.registration', compact('password'), function ($message) use($admin) {
         $message->to($admin->getRegistrationEmail(), $admin->getName())->subject('Welcome!');
     });
 }
开发者ID:vinelab,项目名称:agency,代码行数:7,代码来源:AdminRegistrationEmailNotifier.php

示例3: sendTo

 /**
  * @param mixed   $to
  * @param string  $subject
  * @param string  $view
  * @param array   $data
  */
 public function sendTo($to, $subject, $view, $data = [])
 {
     $to = $to instanceof Notifiable ? $to->getEmail() : $to;
     return $this->mail->send($view, $data, function ($message) use($to, $subject) {
         $message->to($to)->subject($subject);
     });
 }
开发者ID:adriancatalinsv,项目名称:fiip,代码行数:13,代码来源:Mailer.php

示例4: handle

 /**
  * Handle the event.
  *
  * @param  CheckoutEvent $event
  * @return void
  */
 public function handle(CheckoutEvent $event)
 {
     $user = $event->getUser();
     $order = $event->getOrder();
     return $this->mailer->send('emails.checkout', ['user' => $user, 'order' => $order], function ($message) use($user) {
         $message->to($user->email, $user->name)->subject("{$user->name}, seu pedido foi realizado com sucesso!");
     });
 }
开发者ID:netoudi,项目名称:laravel,代码行数:14,代码来源:SendEmailListener.php

示例5: handle

 public function handle(UserCreatedEvent $event)
 {
     $user = $event->getUser();
     $plainPassword = $event->getPlainPassword();
     return $this->mailer->send('email.registration', ['username' => $user->email, 'password' => $plainPassword], function ($message) use($user) {
         $message->to($user->email, $user->name)->subject("{$user->name}, your account was created!");
     });
 }
开发者ID:netoudi,项目名称:laravel-tdd,代码行数:8,代码来源:EmailCreatedAccountListener.php

示例6: publish

 public function publish(Mailable $mailable)
 {
     if ($this->queue && $this->mailer instanceof Mailer) {
         $delay = env("MAIL_DEFAULT_DELAY", 0);
         return $this->mailer->laterOn($this->queue, $delay, $mailable);
     } else {
         $this->mailer->send($mailable);
     }
 }
开发者ID:chatbox-inc,项目名称:mailclerk,代码行数:9,代码来源:MailClerk.php

示例7: handle

 /**
  * @param \Otman\Events\UserRegistered $event
  */
 public function handle(UserRegistered $event)
 {
     $user = $event->getUser();
     $data = array('user' => $user);
     $this->mailer->send('emails.registration', $data, function ($message) use($user) {
         $message->from('noreply@otman.org', 'OT Manager');
         $message->to($user->email, 'Anonymous User')->subject('Welcome!');
     });
 }
开发者ID:mahemrai,项目名称:otman,代码行数:12,代码来源:EmailRegistrationConfirmation.php

示例8: send

 /**
  * Sends an email using laravel's mailer.
  *
  * @param array|string $views
  * @param mixed        $data
  * @param $callback
  *
  * @return bool
  */
 public function send($views, $data, $callback)
 {
     try {
         $this->mail->send($views, $data, $callback);
         return true;
     } catch (Swift_TransportException $e) {
         return false;
     }
 }
开发者ID:redknitin,项目名称:maintenance,代码行数:18,代码来源:MailService.php

示例9: send

 /**
  * Send or queue the current email.
  */
 public function send()
 {
     $this->mailer->send([$this->view_html, $this->view_plain], $this->data, function (\Illuminate\Mail\Message $message) {
         $message->to($this->to);
         $message->subject($this->subject);
         if ($this->attachment) {
             $message->attach($this->attachment);
         }
     });
 }
开发者ID:bhutanio,项目名称:laravel-utilities,代码行数:13,代码来源:Emailer.php

示例10: handle

 /**
  * @param \Otman\Events\OvertimeRequested  $event
  */
 public function handle(OvertimeRequested $event)
 {
     $manager = $event->getUser()->getManager();
     $data = array('user' => $event->getUser(), 'overtime' => $event->getOvertime());
     $this->mailer->send('emails.overtime_request', $data, function ($message) use($manager) {
         $message->from('noreply@otman.org', 'OT Manager');
         $message->to($manager->email, $this->setMailingName($manager));
         $message->subject('New Overtime request submitted');
     });
 }
开发者ID:mahemrai,项目名称:otman,代码行数:13,代码来源:EmailOvertimeRequest.php

示例11: sendVerificationEmail

 /**
  * Send the email for user's email address verification.
  *
  * @param string $name
  * @param string $email
  *
  * @return string
  */
 public function sendVerificationEmail($name, $email)
 {
     // generate verification code
     $verification_code = $this->verifier->newCode($email);
     // send verification email
     $this->mailer->send('emails.auth.verification', compact('name', 'email', 'verification_code'), function ($message) use($name, $email) {
         $message->to($email, $name)->subject(Lang::get('email.email_verification'));
     });
     return $verification_code;
 }
开发者ID:vinelab,项目名称:agency,代码行数:18,代码来源:Mailer.php

示例12: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     foreach ($this->recipients as $recipient) {
         $mailer->send('emails.reports.efficiency_report', ['logs' => $this->logs], function ($message) use($recipient) {
             $message->from('production@mtech.co.za', 'Production @ MTech SA')->to($recipient->email, $recipient->name)->subject(Carbon::now()->format('j M Y A') . ' Efficiency Report');
         });
     }
     //        Email production admin
     $mailer->send('emails.reports.efficiency_report', ['logs' => $this->logs], function ($message) {
         $message->from('production@mtech.co.za', 'Production @ MTech SA')->to('pm@mtech.co.za', 'Production Management')->subject(Carbon::now()->format('j M Y A') . ' Efficiency Report');
     });
 }
开发者ID:buys-fran,项目名称:mtech-mis,代码行数:17,代码来源:EmailEfficiencyReport.php

示例13: handle

 /**
  * Handle the event.
  *
  * @param Created $event
  *
  * @return void
  */
 public function handle(Created $event)
 {
     $users = $this->user->whereIsAdministrator()->get();
     foreach ($users as $user) {
         // Only notify users who don't own the ticket.
         if ($event->issue->user->id != $user->id) {
             $this->mailer->send('emails.issues.new', compact('event'), function ($m) use($event, $user) {
                 $m->to($user->email);
                 $m->subject("New Ticket: {$event->issue->title}");
             });
         }
     }
 }
开发者ID:stevebauman,项目名称:ithub,代码行数:20,代码来源:EmailAdministratorsAboutNewTicket.php

示例14: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mail)
 {
     $group = $this->ticket->group_id;
     $customers = Group::where('id', $group)->first()->customers()->get();
     $_customers = [];
     foreach ($customers as $customer) {
         $_customers[] = $customer->id;
     }
     $sys_name = Settings::where('name', 'sys_name')->first();
     $user = User::whereIn('customer_id', $_customers)->get();
     foreach ($user as $_user) {
         $mail->send('emails.updateticket', ['user' => $_user, 'ticket' => $this->ticket, 'response' => $this->response, 'sys_name' => $sys_name], function ($m) use($_user) {
             $m->to($_user->email, $_user->first_name . ' ' . $_user->last_name)->subject('Ticket updated - ' . $this->ticket->track_id . ' [' . $this->ticket->status->name . ']');
             if (count($this->response->attachments()->get()) > 0) {
                 foreach ($this->response->attachments as $attachment) {
                     $m->attach(storage_path() . '/attachments/' . $this->ticket->id . '/' . $attachment->name);
                 }
             }
         });
     }
     // Cleanup variables
     unset($this->ticket);
     unset($this->response);
     unset($group);
     unset($customers);
     unset($user);
     unset($sys_name);
     unset($_customers);
 }
开发者ID:stryker250,项目名称:simple_ticket,代码行数:34,代码来源:EmailUpdatedTicket.php

示例15: send

 /**
  * Send a new message using a view.
  *
  * @param  string|array  $view
  * @param  array  $data
  * @param  \Closure|string  $callback
  * @return mixed
  */
 public function send($view, array $data, $callback)
 {
     if ($this->autoResetEnabled()) {
         $this->resetSwiftTransport();
     }
     return $this->mailer->send($view, $data, $callback);
 }
开发者ID:namilaRadith,项目名称:AmalyaReach,代码行数:15,代码来源:Mailer.php


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