diff --git a/app/Mail/InvoiceEmail.php b/app/Mail/InvoiceEmail.php index 5b8bdda..a65622a 100644 --- a/app/Mail/InvoiceEmail.php +++ b/app/Mail/InvoiceEmail.php @@ -9,7 +9,7 @@ use Illuminate\Mail\Mailables\Content; use Illuminate\Mail\Mailables\Envelope; use Illuminate\Queue\SerializesModels; -use App\Models\Invoice; +use App\Models\{Invoice,User}; class InvoiceEmail extends Mailable implements ShouldQueue { @@ -33,7 +33,11 @@ class InvoiceEmail extends Mailable implements ShouldQueue */ public function envelope(): Envelope { + // Send an email to an admin that the invoice was created + $uo = User::where('email',config('osb.admin'))->sole(); + return new Envelope( + bcc: $uo->email, subject: sprintf('Invoice %d for services, due %s', $this->io->lid, $this->io->due_at->format('Y-m-d')),