mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Inject small delay when sending emails
This commit is contained in:
parent
af8cd6f19d
commit
52c0bcbc18
@ -725,7 +725,7 @@ class InvoiceController extends BaseController
|
|||||||
$invoice->service()->touchReminder($this->reminder_template)->deletePdf()->save();
|
$invoice->service()->touchReminder($this->reminder_template)->deletePdf()->save();
|
||||||
|
|
||||||
$invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($invoice) {
|
$invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($invoice) {
|
||||||
EmailEntity::dispatch($invitation, $invoice->company, $this->reminder_template);
|
EmailEntity::dispatch($invitation, $invoice->company, $this->reminder_template)->delay(now()->addSeconds(30));
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($invoice->invitations->count() >= 1) {
|
if ($invoice->invitations->count() >= 1) {
|
||||||
|
@ -201,18 +201,8 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
|
|
||||||
if(!Storage::disk($this->disk)->exists($path))
|
if(!Storage::disk($this->disk)->exists($path))
|
||||||
Storage::disk($this->disk)->makeDirectory($path, 0775);
|
Storage::disk($this->disk)->makeDirectory($path, 0775);
|
||||||
|
|
||||||
// nlog($file_path);
|
|
||||||
|
|
||||||
Storage::disk($this->disk)->put($file_path, $pdf);
|
Storage::disk($this->disk)->put($file_path, $pdf);
|
||||||
|
|
||||||
$path = Storage::disk($this->disk)->path($file_path);
|
|
||||||
$url = Storage::disk($this->disk)->url($file_path);
|
|
||||||
|
|
||||||
info("disk = " . $this->disk);
|
|
||||||
info($path);
|
|
||||||
info($url);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(\Exception $e)
|
catch(\Exception $e)
|
||||||
|
@ -112,8 +112,6 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
|
|
||||||
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
|
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
|
||||||
|
|
||||||
CreateEntityPdf::dispatchNow($this->invitation);
|
|
||||||
|
|
||||||
if(Ninja::isHosted())
|
if(Ninja::isHosted())
|
||||||
$this->setAttachments([$this->invoice->pdf_file_path($this->invitation, 'url', true)]);
|
$this->setAttachments([$this->invoice->pdf_file_path($this->invitation, 'url', true)]);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user