mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 11:04:41 -04:00
Fix for tests
This commit is contained in:
parent
c71c8c663c
commit
b4b2026635
@ -9,6 +9,7 @@ use Illuminate\Queue\InteractsWithQueue;
|
|||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
use App;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SendInvoiceEmail.
|
* Class SendInvoiceEmail.
|
||||||
@ -61,13 +62,13 @@ class SendInvoiceEmail extends Job implements ShouldQueue
|
|||||||
public function handle(ContactMailer $mailer)
|
public function handle(ContactMailer $mailer)
|
||||||
{
|
{
|
||||||
// send email as user
|
// send email as user
|
||||||
if ($this->userId) {
|
if (App::runningInConsole() && $this->userId) {
|
||||||
Auth::loginUsingId($this->userId);
|
Auth::loginUsingId($this->userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mailer->sendInvoice($this->invoice, $this->reminder, $this->template);
|
$mailer->sendInvoice($this->invoice, $this->reminder, $this->template);
|
||||||
|
|
||||||
if ($this->userId) {
|
if (App::runningInConsole() && $this->userId) {
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user