diff --git a/src/app/Jobs/Password/RetentionEmailJob.php b/src/app/Jobs/Password/RetentionEmailJob.php index e086c64e..8432768b 100644 --- a/src/app/Jobs/Password/RetentionEmailJob.php +++ b/src/app/Jobs/Password/RetentionEmailJob.php @@ -1,73 +1,73 @@ user = $user; $this->expiresOn = $expiresOn; } /** * Execute the job. * * @return void */ public function handle() { if (!$this->user->isLdapReady() || !$this->user->isImapReady()) { // The account isn't ready for mail delivery return; } // TODO: Should we check if the password didn't update since // the job has been created? \App\Mail\Helper::sendMail( new PasswordExpirationReminder($this->user, $this->expiresOn), $this->user->tenant_id, ['to' => $this->user->email] ); // Remember when we sent the email notification $this->user->setSetting('password_expiration_warning', \now()->toDateTimeString()); } } diff --git a/src/app/Jobs/PasswordResetEmail.php b/src/app/Jobs/PasswordResetEmail.php index 3d2b563b..15973ccd 100644 --- a/src/app/Jobs/PasswordResetEmail.php +++ b/src/app/Jobs/PasswordResetEmail.php @@ -1,67 +1,59 @@ code = $code; } - /** - * Determine the time at which the job should timeout. - * - * @return \DateTime - */ - public function retryUntil() - { - // FIXME: I think it does not make sense to continue trying after 1 hour - return now()->addHours(1); - } - /** * Execute the job. * * @return void */ public function handle() { $email = $this->code->user->getSetting('external_email'); \App\Mail\Helper::sendMail( new PasswordReset($this->code), $this->code->user->tenant_id, ['to' => $email] ); } } diff --git a/src/app/Jobs/PaymentEmail.php b/src/app/Jobs/PaymentEmail.php index 8807001b..a17e3fd9 100644 --- a/src/app/Jobs/PaymentEmail.php +++ b/src/app/Jobs/PaymentEmail.php @@ -1,101 +1,101 @@ payment = $payment; $this->controller = $controller; } /** * Execute the job. * * @return void */ public function handle() { $wallet = $this->payment->wallet; if (empty($this->controller)) { $this->controller = $wallet->owner; } if (empty($this->controller)) { return; } if ($this->payment->status == Payment::STATUS_PAID) { $mail = new \App\Mail\PaymentSuccess($this->payment, $this->controller); $label = "Success"; } elseif ( $this->payment->status == Payment::STATUS_EXPIRED || $this->payment->status == Payment::STATUS_FAILED ) { $mail = new \App\Mail\PaymentFailure($this->payment, $this->controller); $label = "Failure"; } else { return; } list($to, $cc) = \App\Mail\Helper::userEmails($this->controller); if (!empty($to) || !empty($cc)) { $params = [ 'to' => $to, 'cc' => $cc, 'add' => " for {$wallet->id}", ]; \App\Mail\Helper::sendMail($mail, $this->controller->tenant_id, $params); } /* // Send the email to all wallet controllers too if ($wallet->owner->id == $this->controller->id) { $this->wallet->controllers->each(function ($controller) { self::dispatch($this->payment, $controller); } }); */ } } diff --git a/src/app/Jobs/PaymentMandateDisabledEmail.php b/src/app/Jobs/PaymentMandateDisabledEmail.php index d26fed03..db43a203 100644 --- a/src/app/Jobs/PaymentMandateDisabledEmail.php +++ b/src/app/Jobs/PaymentMandateDisabledEmail.php @@ -1,89 +1,89 @@ wallet = $wallet; $this->controller = $controller; } /** * Execute the job. * * @return void */ public function handle() { if (empty($this->controller)) { $this->controller = $this->wallet->owner; } if (empty($this->controller)) { return; } $mail = new PaymentMandateDisabled($this->wallet, $this->controller); list($to, $cc) = \App\Mail\Helper::userEmails($this->controller); if (!empty($to) || !empty($cc)) { $params = [ 'to' => $to, 'cc' => $cc, 'add' => " for {$this->wallet->id}", ]; \App\Mail\Helper::sendMail($mail, $this->controller->tenant_id, $params); } /* // Send the email to all controllers too if ($this->controller->id == $this->wallet->owner->id) { $this->wallet->controllers->each(function ($controller) { self::dispatch($this->wallet, $controller); } }); */ } } diff --git a/src/app/Jobs/SignupVerificationEmail.php b/src/app/Jobs/SignupVerificationEmail.php index 46516b63..90fbada1 100644 --- a/src/app/Jobs/SignupVerificationEmail.php +++ b/src/app/Jobs/SignupVerificationEmail.php @@ -1,66 +1,58 @@ code = $code; } - /** - * Determine the time at which the job should timeout. - * - * @return \DateTime - */ - public function retryUntil() - { - // FIXME: I think it does not make sense to continue trying after 1 hour - return now()->addHours(1); - } - /** * Execute the job. * * @return void */ public function handle() { \App\Mail\Helper::sendMail( new SignupVerification($this->code), null, ['to' => $this->code->email] ); } } diff --git a/src/app/Jobs/SignupVerificationSMS.php b/src/app/Jobs/SignupVerificationSMS.php index 03586352..d25617c2 100644 --- a/src/app/Jobs/SignupVerificationSMS.php +++ b/src/app/Jobs/SignupVerificationSMS.php @@ -1,61 +1,53 @@ code = $code; } - /** - * Determine the time at which the job should timeout. - * - * @return \DateTime - */ - public function retryUntil() - { - // FIXME: I think it does not make sense to continue trying after 1 hour - return now()->addHours(1); - } - /** * Execute the job. * * @return void */ public function handle() { // TODO } } diff --git a/src/app/Jobs/TrialEndEmail.php b/src/app/Jobs/TrialEndEmail.php index 73d3280f..ba36c292 100644 --- a/src/app/Jobs/TrialEndEmail.php +++ b/src/app/Jobs/TrialEndEmail.php @@ -1,68 +1,60 @@ account = $account; } - /** - * Determine the time at which the job should timeout. - * - * @return \DateTime - */ - public function retryUntil() - { - // FIXME: I think it does not make sense to continue trying after 24 hours - return now()->addHours(24); - } - /** * Execute the job. * * @return void */ public function handle() { // Skip accounts that aren't ready for mail delivery if ($this->account->isLdapReady() && $this->account->isImapReady()) { \App\Mail\Helper::sendMail( new TrialEnd($this->account), $this->account->tenant_id, ['to' => $this->account->email] ); } } }