diff --git a/_ide_helper.php b/_ide_helper.php
index c5562d34111d..a14275a20cd5 100644
--- a/_ide_helper.php
+++ b/_ide_helper.php
@@ -4,7 +4,7 @@
/**
* A helper file for Laravel, to provide autocomplete information to your IDE
- * Generated for Laravel 9.52.0.
+ * Generated for Laravel 9.52.4.
*
* This file should not be included in your code, only analyzed by your IDE!
*
@@ -10860,12 +10860,12 @@
* Clones a request and overrides some of its parameters.
*
* @return static
- * @param array $query The GET parameters
- * @param array $request The POST parameters
- * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
- * @param array $cookies The COOKIE parameters
- * @param array $files The FILES parameters
- * @param array $server The SERVER parameters
+ * @param array|null $query The GET parameters
+ * @param array|null $request The POST parameters
+ * @param array|null $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
+ * @param array|null $cookies The COOKIE parameters
+ * @param array|null $files The FILES parameters
+ * @param array|null $server The SERVER parameters
* @static
*/
public static function duplicate($query = null, $request = null, $attributes = null, $cookies = null, $files = null, $server = null)
diff --git a/app/Jobs/Entity/EmailEntity.php b/app/Jobs/Entity/EmailEntity.php
index 26998794040d..561cb0ed83b6 100644
--- a/app/Jobs/Entity/EmailEntity.php
+++ b/app/Jobs/Entity/EmailEntity.php
@@ -112,14 +112,14 @@ class EmailEntity implements ShouldQueue
$this->entity->service()->markSent()->save();
$nmo = new NinjaMailerObject;
- $nmo->mailable = new TemplateEmail($this->email_entity_builder, $this->invitation->contact, $this->invitation);
- $nmo->company = $this->company;
+ $nmo->mailable = new TemplateEmail($this->email_entity_builder, $this->invitation->contact->withoutRelations(), $this->invitation->withoutRelations());
+ $nmo->company = $this->company->withoutRelations();
$nmo->settings = $this->settings;
- $nmo->to_user = $this->invitation->contact;
+ $nmo->to_user = $this->invitation->contact->withoutRelations();
$nmo->entity_string = $this->entity_string;
- $nmo->invitation = $this->invitation;
+ $nmo->invitation = $this->invitation->withoutRelations();
$nmo->reminder_template = $this->reminder_template;
- $nmo->entity = $this->entity;
+ $nmo->entity = $this->entity->withoutRelations();
NinjaMailerJob::dispatch($nmo);
diff --git a/app/Jobs/Mail/NinjaMailerObject.php b/app/Jobs/Mail/NinjaMailerObject.php
index b9207f29a4aa..1d973cb90275 100644
--- a/app/Jobs/Mail/NinjaMailerObject.php
+++ b/app/Jobs/Mail/NinjaMailerObject.php
@@ -39,4 +39,6 @@ class NinjaMailerObject
/* @var bool | App\Models\Invoice | app\Models\Quote | app\Models\Credit | app\Models\RecurringInvoice | app\Models\PurchaseOrder $invitation*/
public $entity = false;
+
+ public $reminder_template = '';
}
diff --git a/app/Mail/Engine/InvoiceEmailEngine.php b/app/Mail/Engine/InvoiceEmailEngine.php
index 9ba08c127f86..46604e71690e 100644
--- a/app/Mail/Engine/InvoiceEmailEngine.php
+++ b/app/Mail/Engine/InvoiceEmailEngine.php
@@ -114,15 +114,19 @@ class InvoiceEmailEngine extends BaseEmailEngine
);
}
+ $contact = $this->contact->withoutRelations();
+ $variables = (new HtmlEngine($this->invitation))->makeValues();
+ $invitation = $this->invitation->withoutRelations();
+
$this->setTemplate($this->client->getSetting('email_style'))
- ->setContact($this->contact)
- ->setVariables((new HtmlEngine($this->invitation))->makeValues())//move make values into the htmlengine
+ ->setContact($contact)
+ ->setVariables($variables)//move make values into the htmlengine
->setSubject($subject_template)
->setBody($body_template)
- ->setFooter("".ctrans('texts.view_invoice').'')
- ->setViewLink($this->invitation->getLink())
+ ->setFooter("".ctrans('texts.view_invoice').'')
+ ->setViewLink($invitation->getLink())
->setViewText(ctrans('texts.view_invoice'))
- ->setInvitation($this->invitation)
+ ->setInvitation($invitation)
->setTextBody($text_body);
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
@@ -206,6 +210,15 @@ class InvoiceEmailEngine extends BaseEmailEngine
}
}
+ $this->invitation = null;
+ $contact = null;
+ $variables = null;
+ $this->invoice = null;
+ $this->client = null;
+ $pdf = null;
+ $expenses = null;
+ $tasks = null;
+
return $this;
}
}