コード例 #1
0
ファイル: SendMail.php プロジェクト: doankhoi/Application
 /**
  * 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');
     });
 }
コード例 #2
0
 /**
  * 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']);
     });
 }
 /**
  * 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');
     });
 }
 /**
  * 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');
     });
 }
コード例 #5
0
 /**
  * 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();
 }
コード例 #6
0
 /**
  * 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');
     });
 }
コード例 #7
0
ファイル: BaseMailer.php プロジェクト: srlabs/groundwork
 /**
  * Convenience function for sending mail
  *
  * @param $email
  * @param $subject
  * @param $view
  * @param array $data
  */
 public function sendTo($email, $subject, $view, $data = array())
 {
     $sender = $this->gatherSenderAddress();
     $this->mailer->queue($view, $data, function ($message) use($email, $subject, $sender) {
         $message->to($email)->from($sender['address'], $sender['name'])->subject($subject);
     });
 }
コード例 #8
0
 /**
  * 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());
 }
コード例 #9
0
 /**
  * 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();
     }
 }
コード例 #10
0
 /**
  * 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');
     });
 }
コード例 #11
0
ファイル: SendInviteEmail.php プロジェクト: vishnu-b/invite
 /**
  * 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');
     });
 }
コード例 #12
0
 /**
  * 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();
 }
コード例 #13
0
 /**
  * Execute the job.
  *
  * @param Mailer $mailer
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.welcome', [], function ($message) {
         $message->from(env('MAIL_FROM'), 'Easymanage.in');
         $message->to($this->emailAddress)->subject('Welcome to Society Manager');
     });
 }
コード例 #14
0
ファイル: SendMail.php プロジェクト: jhuhandha/lblog
 /**
  * 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'));
     });
 }
コード例 #15
0
 /**
  * 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('*****@*****.**', 'Your Application');
         $m->to('*****@*****.**', 'destinatario')->subject('Task creato!');
     });
 }
コード例 #16
0
 /**
  * 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']);
         }
     });
 }
コード例 #17
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.reminder', ['user' => $this->user], function ($m) {
         //
     });
     //$this->user->reminders()->create(...);
 }
コード例 #18
0
ファイル: VerifyReview.php プロジェクト: adrianicn/IguanaTrip
 /**
  * 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");
     });
 }
コード例 #19
0
 /**
  * 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");
     });
 }
コード例 #20
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.mailer', ['user' => $this->user], function ($m) {
         $m->from('*****@*****.**');
         $m->to('*****@*****.**');
     });
 }
コード例 #21
0
 /**
  * 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('*****@*****.**', 'Whatscarrier');
         $message->subject('You have received new purchase')->to('*****@*****.**');
     });
 }
コード例 #22
0
 /**
  * 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');
     });
 }
コード例 #23
0
ファイル: SendEmail.php プロジェクト: liubo2055/test-lazada
 /**
  * Execute the job.
  *
  * @param  Mailer  $mailer
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $message = $this->message;
     return $mailer->send('emails.reminder', [], function ($m) use($message) {
         $m->to('*****@*****.**', 'Lazada Reporter')->sender('*****@*****.**', 'Lazada Operator')->subject($message);
     });
 }
コード例 #24
0
 /**
  * Execute the job.
  *
  * @param Mailer $mailer
  */
 public function handle(Mailer $mailer)
 {
     $emailData = ['name' => $this->name, 'email' => $this->email, 'message' => $this->message];
     $mailer->send('emails.contact', ['contactData' => $emailData], function ($mail) {
         // Create the message
         $mail->from('*****@*****.**', 'Portfolio Site')->to('*****@*****.**', 'Richard Nwankwo')->subject('You\'ve been contacted!');
     });
 }
コード例 #25
0
 public function submit(Mailer $mailer, AskDestlerRequest $request)
 {
     $askdestlerRecipient = app('config')['witr.askdestler_recipient'];
     $mailer->send('emails.askdestler', $request->all(), function ($message) use($askdestlerRecipient) {
         $message->to($askdestlerRecipient['email'], $askdestlerRecipient['name'])->subject('WITR Ask Destler Submission');
     });
     return redirect()->route('askdestler')->with('success', 'Question Submitted!');
 }
コード例 #26
0
 public function handle(Mailer $mailer)
 {
     $email_data = array('name' => $this->attendee->firstname . ' ' . $this->attendee->lastname, 'event' => $this->attendee->event()->first()->title, 'payment' => $this->attendee->amount_paid);
     $mailer->send('emails.invoice', $email_data, function ($m) {
         $m->from('*****@*****.**', 'All Access RMS');
         $m->to('*****@*****.**')->subject('Welcome to AllAccessRMS!');
     });
 }
コード例 #27
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $email = $this->email;
     $data = '';
     $mailer->send('emails.newsletter.latest', ['variable' => $data], function ($message) use($email) {
         $message->subject('Nh?ng bài vi?t quan tâm!')->from('*****@*****.**', 'Admin http:://hoc.vet')->to($email, '');
     });
 }
コード例 #28
0
 /**
  * Execute the job.
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.contact', $this->details, function ($message) {
         $message->from($this->details['email'], $this->details['name']);
         $message->subject('MrSwitch Contact Form - Entry');
         $message->to("*****@*****.**");
     });
 }
コード例 #29
0
ファイル: SendReplyEmail.php プロジェクト: hisambahaa/DARES
 /**
  * Execute the job.
  *
  * @param  Mailer  $mailer
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     if (!filter_var($this->email, FILTER_VALIDATE_EMAIL) === false) {
         $mailer->send('contact::emails.reply', ['content' => $this->content], function ($m) {
             $m->subject('مركز التعليم عن بعد ، كلية العلوم الشرعية')->from('*****@*****.**', 'مركز التعليم عن بعد ، كلية العلوم الشرعية')->to($this->email);
         });
     }
 }
コード例 #30
0
 /**
  * Execute the job.
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $mailer->send('emails.newsletters.subscribed', ['subscriber' => $this->subscriber], function ($message) {
         $message->from('*****@*****.**', 'Mr. Switch');
         $message->subject('Your newsletter subscription is confirmed');
         $message->to($this->subscriber->email);
     });
 }