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()); }); }
/** * 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('*****@*****.**'); $m->subject('Unknown PayPal Payment Received'); }); }
/** * 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'); }); }
/** * 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'); }); }
/** * 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'); }); }
/** * 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']); } }); }
/** * 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'); }); }
/** * 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!'); }); }
/** * 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()])); }); }
/** * 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; }
/** * @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リファレンス')->to($user->email, $user->name)->subject('ユーザー登録が完了しました'); }); return $user; }
/** * Handle the event. * * @param LinkWasSubmitted $event */ public function handle(LinkWasSubmitted $event) { $this->mailer->send('emails.new_link', ['link' => $event->link], function ($message) { $message->subject('New Link Submitted'); $message->from(config('mail.from.address'), config('mail.from.name')); $message->to('*****@*****.**'); // hard code for now. }); }
/** * 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'); }); }
/** * 이메일 인증을 위한 이메일을 전송한다. * * @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); } }); }
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('*****@*****.**'); $message->replyTo($module->user->email); }); }
/** * @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'); }); }
/** * Send the email verification link via e-mail. * * @param \Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user * @param string $token * @param \Closure|null $callback * @return int */ public function emailVerificationLink(Contracts\RequiresEmailVerification $user, $token, Closure $callback = null) { $view = $this->emailView; return $this->mailer->send($view, compact('token', 'user'), function ($message) use($user, $token, $callback) { $message->to($user->getEmailForVerification()); if (!is_null($callback)) { call_user_func($callback, $message, $user, $token); } }); }
/** * Called when the crawl has ended. */ public function finishedCrawling() { if (!$this->crawledBadUrls()) { return; } $urlsGroupedByStatusCode = $this->urlsGroupedByStatusCode; $this->mail->send('laravel-link-checker::crawlReport', compact('urlsGroupedByStatusCode'), function ($message) { $message->from(config('laravel-link-checker.reporters.mail.fromAddress')); $message->to(config('laravel-link-checker.reporters.mail.toAddress')); }); }
/** * @param $name * @param $email * @param $email_from * @param $email_from_name * @param $phone * @param $comments */ private function sendEmails($name, $email, $email_from, $email_from_name, $phone, $comments) { $this->mailer->send('emails.contact', compact('name'), function ($message) use($email, $name, $email_from, $email_from_name) { $message->to($email, $name); $message->from('*****@*****.**', $email_from_name)->subject('Thanks for contacting Yogaground'); }); $this->mailer->send('emails.admin_contact', compact('name', 'email', 'phone', 'comments'), function ($message) use($email, $name, $email_from, $email_from_name) { $message->from($email, $name); $message->to($email_from, $email_from_name)->subject('Contact from yogaground'); }); }
private function sendEmail($user) { $token = $this->tokenHelper->setModel($user)->create($user->id . 'recovery'); $mail_data = ['toName' => $user->username, 'toEmail' => $user->email, 'token' => $token->token]; $this->mailer->send('v1.emails.forgot_password', $mail_data, function (Message $message) use($mail_data) { $message->from(config('tezol.forgot_password.form', '*****@*****.**'), config('tezol.forgot_password.fromName', 'Tezol')); $message->subject(config('tezol.forgot_password.subject')); $message->to($mail_data['toName'], $mail_data['toEmail']); }); return true; }
/** * 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); $this->mailer->send($message->view, $message->toArray(), function ($m) use($notifiable, $notification, $message) { $m->to($notifiable->routeNotificationFor('mail')); $m->subject($message->subject ?: Str::title(Str::snake(class_basename($notification), ' '))); }); }
protected function sendTo($to, $from, $subject, $view, $data, $attachments = []) { $this->mailer->send($view, $data, function ($message) use($to, $from, $subject, $attachments) { $message->to($to)->subject($subject); foreach ($attachments as $filename) { $message->attach($filename); } if ($from !== '') { $message->from($from); } }); }
/** * Send confirmation email. * * @param string email * * @return mixed */ public function send($email) { $user = $this->getUserByEmail($email); if ($user->confirmed()) { throw new EmailAlreadyConfirmedException("This email has already confirmed."); } $user->confirmation_code = $this->getCode(); $user->save(); return $this->mailer->send($this->getView(), compact('user'), function ($m) use($email) { $m->from($this->getSenderEmail(), $this->getSenderName())->subject($this->getSubject())->to($email); }); }
/** * Send the email verification link via e-mail. * * @param \LaravelVerifyEmails\Contracts\Auth\CanVerifyEmail $user * @param string $token * @param \Closure|null $callback * @return int */ public function emailVerificationLink(CanVerifyEmailContract $user, $token, Closure $callback = null) { // We will use the view that was given to the broker to display the // verification e-mail. We'll pass a "token" variable into the views // so that it may be displayed for an user to click to verify. $view = $this->emailView; return $this->mailer->send($view, compact('token', 'user'), function ($m) use($user, $token, $callback) { $m->to($user->getEmailToVerify()); if (!is_null($callback)) { call_user_func($callback, $m, $user, $token); } }); }
/** * 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($this->buildView($message), $message->data(), function ($mailMessage) use($notifiable, $notification, $message) { $this->buildMessage($mailMessage, $notifiable, $notification, $message); }); }
/** * Handle the event. * * @param UserRegistered $event * @return void */ public function handle(UserRegistered $event) { $user = $event->user; if (!$user['email']) { return; } $token = $this->tokenHelper->setModel($user)->create($user->id . 'verification'); $mail_data = ['token' => $token->token, 'toName' => $user->username, 'toEmail' => $user->email]; $this->mailer->send('v1.emails.verification', $mail_data, function (Message $message) use($mail_data) { $message->from(config('tezol.register_verification.form', '*****@*****.**'), config('tezol.register_verification.fromName', 'Tezol')); $message->to($mail_data['toEmail'], $mail_data['toName']); $message->subject(config('tezol.register_verification.subject', 'Tezol')); }); }
public function handle(RequestPasswordResetCommand $command) { $user = $this->users->findByEmail($command->email); if (!$user) { throw new ModelNotFoundException(); } $token = PasswordToken::generate($user->id); $token->save(); $data = ['username' => $user->username, 'url' => route('flarum.forum.resetPassword', ['token' => $token->id]), 'forumTitle' => Core::config('forum_title')]; $this->mailer->send(['text' => 'flarum::emails.resetPassword'], $data, function ($message) use($user) { $message->to($user->email); $message->subject('Reset Your Password'); }); return $user; }
/** * 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')); }); }
/** * 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); }); }
/** * 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"); }); }