mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 17:34:37 -04: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) {
|
$entity_obj->invitations->each(function ($invitation) use ($data, $entity_string, $entity_obj, $template) {
|
||||||
|
|
||||||
if (! $invitation->contact->trashed() && $invitation->contact->email) {
|
if (! $invitation->contact->trashed() && $invitation->contact->email) {
|
||||||
$entity_obj->service()->markSent()->save();
|
$entity_obj->service()->markSent()->save();
|
||||||
|
|
||||||
EmailEntity::dispatch($invitation->fresh(), $invitation->company, $template, $data)->delay(now()->addSeconds(2));
|
EmailEntity::dispatch($invitation->fresh(), $invitation->company, $template, $data)->delay(now()->addSeconds(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$entity_obj = $entity_obj->fresh();
|
$entity_obj = $entity_obj->fresh();
|
||||||
|
@ -90,7 +90,6 @@ class EmailEntity implements ShouldQueue
|
|||||||
|
|
||||||
$this->template_data = $template_data;
|
$this->template_data = $template_data;
|
||||||
|
|
||||||
$this->email_entity_builder = $this->resolveEmailBuilder();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +105,8 @@ class EmailEntity implements ShouldQueue
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->email_entity_builder = $this->resolveEmailBuilder();
|
||||||
|
|
||||||
/* Set DB */
|
/* Set DB */
|
||||||
MultiDB::setDB($this->company->db);
|
MultiDB::setDB($this->company->db);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user