mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-05 23:01:07 +00:00
feat(sales): fresh sales implementation
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Sales\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Tells the company that one of its invoices has just been opened.
|
||||
*
|
||||
* This one travels inward, to the address the company nominated for view
|
||||
* notifications, so it goes out under the installation's own mail identity
|
||||
* rather than the address the invoice itself was sent from.
|
||||
*/
|
||||
class InvoiceViewedMail extends Mailable
|
||||
{
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* @param array $data the invoice that was opened and the user it
|
||||
* belongs to, shaped as the view expects them
|
||||
*/
|
||||
public function __construct(
|
||||
$data
|
||||
) {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->subject(__('notification_view_invoice'))
|
||||
->from(config('mail.from.address'), config('mail.from.name'))
|
||||
->markdown('emails.viewed.invoice', [
|
||||
// Handed over as a list, not as a keyed array. The numeric
|
||||
// keys that produces are inert: the view reads $data, which
|
||||
// Laravel already supplies from the public property above.
|
||||
'data',
|
||||
$this->data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user