BCC invoice emails to the admin
This commit is contained in:
parent
a65c81871b
commit
3fc676fa26
@ -9,7 +9,7 @@ use Illuminate\Mail\Mailables\Content;
|
|||||||
use Illuminate\Mail\Mailables\Envelope;
|
use Illuminate\Mail\Mailables\Envelope;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
use App\Models\Invoice;
|
use App\Models\{Invoice,User};
|
||||||
|
|
||||||
class InvoiceEmail extends Mailable implements ShouldQueue
|
class InvoiceEmail extends Mailable implements ShouldQueue
|
||||||
{
|
{
|
||||||
@ -33,7 +33,11 @@ class InvoiceEmail extends Mailable implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function envelope(): Envelope
|
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(
|
return new Envelope(
|
||||||
|
bcc: $uo->email,
|
||||||
subject: sprintf('Invoice %d for services, due %s',
|
subject: sprintf('Invoice %d for services, due %s',
|
||||||
$this->io->lid,
|
$this->io->lid,
|
||||||
$this->io->due_at->format('Y-m-d')),
|
$this->io->due_at->format('Y-m-d')),
|
||||||
|
Loading…
Reference in New Issue
Block a user