mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Fixes for latency when sending emails
This commit is contained in:
parent
14e86b8183
commit
5b63e0fd81
@ -136,11 +136,13 @@ class EmailController extends BaseController
|
||||
}
|
||||
|
||||
$entity_obj->invitations->each(function ($invitation) use ($data, $entity_string, $entity_obj, $template) {
|
||||
|
||||
if (! $invitation->contact->trashed() && $invitation->contact->email) {
|
||||
$entity_obj->service()->markSent()->save();
|
||||
|
||||
EmailEntity::dispatch($invitation->fresh(), $invitation->company, $template, $data)->delay(now()->addSeconds(2));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$entity_obj = $entity_obj->fresh();
|
||||
|
@ -90,7 +90,6 @@ class EmailEntity implements ShouldQueue
|
||||
|
||||
$this->template_data = $template_data;
|
||||
|
||||
$this->email_entity_builder = $this->resolveEmailBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,6 +105,8 @@ class EmailEntity implements ShouldQueue
|
||||
return;
|
||||
}
|
||||
|
||||
$this->email_entity_builder = $this->resolveEmailBuilder();
|
||||
|
||||
/* Set DB */
|
||||
MultiDB::setDB($this->company->db);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user