Fixes for bulk emailing quotes

This commit is contained in:
David Bomba 2020-08-19 12:55:58 +10:00
parent 7b2e60a0d5
commit b2d5a8b070
3 changed files with 5 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class EmailQuote implements ShouldQueue
return $this->logMailError(Mail::failures());
}
$this->quote_invitation->quote->markSent()->save();
$this->quote_invitation->quote->service()->markSent()->save();
}

View File

@ -39,7 +39,7 @@ class SendEmail
* @param string $this->reminder_template The template name ie reminder1
* @return array
*/
public function run(): array
public function run()
{
if (!$this->reminder_template) {
$this->reminder_template = $this->quote->calculateTemplate();
@ -52,5 +52,7 @@ class SendEmail
EmailQuote::dispatchNow($email_builder, $invitation);
}
});
$this->quote->service()->markSent();
}
}

View File

@ -35,6 +35,7 @@ class InvoiceHistoryTransformer extends EntityTransformer
'activity_id' => $this->encodePrimaryKey($backup->activity_id),
'json_backup' => (string) $backup->json_backup ?: '',
'html_backup' => (string) $backup->html_backup ?: '',
'amount' => (float) $backup->amount,
'created_at' => (int)$backup->created_at,
'updated_at' => (int)$backup->updated_at,
];