db); $company = $this->payment_hash->fee_invoice->company; App::setLocale($company->getLocale()); $invoices_string = \implode(', ', collect($this->payment_hash->invoices())->pluck('invoice_number')->toArray()) ?: ''; $body = "Transaction {$this->transaction_reference} has been held for your review in Auth.net based on your Fraud Detection Settings.\n\n\nWe have marked invoices {$invoices_string} as paid in Invoice Ninja.\n\n\nPlease review this transaction in your auth.net account, and authorize if correct to ensure the transaction is finalized as expected.\n\n\nIf these charges need to be cancelled, you will need to delete the payments that have been created in Invoice Ninja."; $mo = new EmailObject(); $mo->subject = "Transaction {$this->transaction_reference} held for review by auth.net"; $mo->body = nl2br($body); $mo->text_body = $body; $mo->company_key = $company->company_key; $mo->html_template = 'email.template.generic'; $mo->to = [new Address($company->owner()->email, $company->owner()->present()->name())]; Email::dispatch($mo, $company); } }