Inheritance: extends App\Ninja\Mailers\Mailer
 /**
  * @param $invoice
  * @param $type
  * @param null $payment
  */
 private function sendEmails($invoice, $type, $payment = null)
 {
     foreach ($invoice->account->users as $user) {
         if ($user->{"notify_{$type}"}) {
             $this->userMailer->sendNotification($user, $invoice, $type, $payment);
         }
     }
 }
 /**
  * Handle the event.
  *
  * @param  UserSignedUp $event
  *
  * @return void
  */
 public function handle(UserSignedUp $event)
 {
     $user = Auth::user();
     if (Utils::isNinjaProd()) {
         $this->userMailer->sendConfirmation($user);
     } elseif (Utils::isNinjaDev()) {
         // do nothing
     } else {
         $this->accountRepo->registerNinjaUser($user);
     }
     session([SESSION_COUNTER => -1]);
 }
Ejemplo n.º 3
0
 /**
  * @param $messageId
  * @param $error
  * @return bool
  */
 public function markBounced($messageId, $error)
 {
     /** @var \App\Models\Invitation $invitation */
     $invitation = Invitation::with('user', 'invoice', 'contact')->whereMessageId($messageId)->first();
     if (!$invitation) {
         return false;
     }
     $invitation->email_error = $error;
     $invitation->save();
     $this->userMailer->sendEmailBounced($invitation);
     return true;
 }
 /**
  * @return \Illuminate\Http\RedirectResponse
  */
 public function resendConfirmation()
 {
     /** @var \App\Models\User $user */
     $user = Auth::user();
     $this->userMailer->sendConfirmation($user);
     return Redirect::to('/settings/' . ACCOUNT_USER_DETAILS)->with('message', trans('texts.confirmation_resent'));
 }