quote = $quote; $this->reminder_template = $reminder_template; $this->contact = $contact; } /** * Builds the correct template to send. * @param string $this->reminder_template The template name ie reminder1 * @return array */ public function run() { if (! $this->reminder_template) { $this->reminder_template = $this->quote->calculateTemplate('quote'); } $this->quote->invitations->each(function ($invitation) { if ($invitation->contact->send_email && $invitation->contact->email) { $email_builder = (new QuoteEmail())->build($invitation, $this->reminder_template); // EmailQuote::dispatchNow($email_builder, $invitation, $invitation->company); EmailEntity::dispatchNow($invitation, $invitation->company); } }); $this->quote->service()->markSent(); } }