payment = $payment; $this->contact = $contact; } /** * Builds the correct template to send. * @return void */ public function run() { $email_builder = (new PaymentEmail())->build($this->payment, $contact); $this->payment->client->contacts->each(function ($contact) use ($email_builder) { if ($contact->send && $contact->email) { EmailPayment::dispatchNow($this->payment, $email_builder, $contact, $this->payment->company); } }); } }