Page MenuHomePhorge

No OneTemporary

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 @@
<?php
namespace App\Jobs\Password;
use App\Mail\PasswordExpirationReminder;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
class RetentionEmailJob implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/** @var bool Delete the job if its models no longer exist. */
public $deleteWhenMissingModels = true;
/** @var int The number of times the job may be attempted. */
- public $tries = 2;
+ public $tries = 3;
/** @var int The number of seconds to wait before retrying the job. */
- public $retryAfter = 10;
+ public $backoff = 30;
/** @var string Password expiration date */
protected $expiresOn;
/** @var \App\User User object */
protected $user;
/**
* Create a new job instance.
*
* @param \App\User $user User object
* @param string $expiresOn Password expiration date
*
* @return void
*/
public function __construct(\App\User $user, string $expiresOn)
{
$this->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 @@
<?php
namespace App\Jobs;
use App\Mail\PasswordReset;
use App\VerificationCode;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
class PasswordResetEmail implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/** @var int The number of times the job may be attempted. */
- public $tries = 2;
+ public $tries = 3;
- /** @var \App\VerificationCode Verification code object */
- protected $code;
+ /** @var int The number of seconds to wait before retrying the job. */
+ public $backoff = 10;
/** @var bool Delete the job if its models no longer exist. */
public $deleteWhenMissingModels = true;
+ /** @var \App\VerificationCode Verification code object */
+ protected $code;
+
/**
* Create a new job instance.
*
* @param \App\VerificationCode $code Verification code object
*
* @return void
*/
public function __construct(VerificationCode $code)
{
$this->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 @@
<?php
namespace App\Jobs;
use App\Payment;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
class PaymentEmail implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/** @var int The number of times the job may be attempted. */
- public $tries = 2;
+ public $tries = 3;
/** @var int The number of seconds to wait before retrying the job. */
- public $backoff = 10;
+ public $backoff = 30;
/** @var bool Delete the job if the wallet no longer exist. */
public $deleteWhenMissingModels = true;
/** @var \App\Payment A payment object */
protected $payment;
/** @var ?\App\User A wallet controller */
protected $controller;
/**
* Create a new job instance.
*
* @param \App\Payment $payment A payment object
* @param \App\User $controller A wallet controller
*
* @return void
*/
public function __construct(Payment $payment, User $controller = null)
{
$this->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 @@
<?php
namespace App\Jobs;
use App\Mail\PaymentMandateDisabled;
use App\User;
use App\Wallet;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
class PaymentMandateDisabledEmail implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/** @var int The number of times the job may be attempted. */
- public $tries = 2;
+ public $tries = 3;
/** @var int The number of seconds to wait before retrying the job. */
- public $backoff = 10;
+ public $backoff = 30;
/** @var bool Delete the job if the wallet no longer exist. */
public $deleteWhenMissingModels = true;
/** @var \App\Wallet A wallet object */
protected $wallet;
/** @var ?\App\User A wallet controller */
protected $controller;
/**
* Create a new job instance.
*
* @param \App\Wallet $wallet A wallet object
* @param \App\User $controller An email recipient (wallet controller)
*
* @return void
*/
public function __construct(Wallet $wallet, User $controller = null)
{
$this->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 @@
<?php
namespace App\Jobs;
use App\Mail\SignupVerification;
use App\SignupCode;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
class SignupVerificationEmail implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/** @var int The number of times the job may be attempted. */
- public $tries = 2;
+ public $tries = 3;
+
+ /** @var int The number of seconds to wait before retrying the job. */
+ public $backoff = 10;
/** @var bool Delete the job if its models no longer exist. */
public $deleteWhenMissingModels = true;
/** @var SignupCode Signup verification code object */
protected $code;
/**
* Create a new job instance.
*
* @param SignupCode $code Verification code object
*
* @return void
*/
public function __construct(SignupCode $code)
{
$this->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 @@
<?php
namespace App\Jobs;
use App\SignupCode;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class SignupVerificationSMS implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/** @var int The number of times the job may be attempted. */
- public $tries = 2;
+ public $tries = 3;
+
+ /** @var int The number of seconds to wait before retrying the job. */
+ public $backoff = 10;
/** @var bool Delete the job if its models no longer exist. */
public $deleteWhenMissingModels = true;
/** @var SignupCode Signup verification code object */
protected $code;
/**
* Create a new job instance.
*
* @param SignupCode $code Verification code object
*
* @return void
*/
public function __construct(SignupCode $code)
{
$this->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 @@
<?php
namespace App\Jobs;
use App\Mail\TrialEnd;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
class TrialEndEmail implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/** @var int The number of times the job may be attempted. */
public $tries = 3;
+ /** @var int The number of seconds to wait before retrying the job. */
+ public $backoff = 30;
+
/** @var bool Delete the job if its models no longer exist. */
public $deleteWhenMissingModels = true;
/** @var \App\User The account owner */
protected $account;
/**
* Create a new job instance.
*
* @param \App\User $account The account owner
*
* @return void
*/
public function __construct(User $account)
{
$this->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]
);
}
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Apr 5, 7:25 AM (13 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
175767
Default Alt Text
(15 KB)

Event Timeline