diff --git a/.gitignore b/.gitignore index 7639c9af..74015e4f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,4 @@ npm-debug.log yarn-error.log .gitignore .env.dev -.env.testing -public/vendor/invoices/logo.png +.env.testing \ No newline at end of file diff --git a/app/Notifications/InvoiceNotification.php b/app/Notifications/InvoiceNotification.php index d4b504b8..3a3acbde 100644 --- a/app/Notifications/InvoiceNotification.php +++ b/app/Notifications/InvoiceNotification.php @@ -4,6 +4,7 @@ namespace App\Notifications; use App\Models\Server; use Illuminate\Bus\Queueable; +use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use LaravelDaily\Invoices\Invoice; @@ -34,22 +35,22 @@ class InvoiceNotification extends Notification */ public function via($notifiable) { - return ['database']; + return ['mail']; } /** * Get the array representation of the notification. * * @param mixed $notifiable - * @return array + * @return MailMessage */ - public function toArray($notifiable) + public function toMail($notifiable) { - return [ - 'title' => "Invoice Created: Nr.".$this->invoice->sequence, - 'content' => " -

Find it here.

- ", - ]; + return (new MailMessage) + ->subject('Your Invoice!') + ->greeting('Your invoice is ready') + ->line("Skurr skurr.") + ->line('damn son.') + ->attach($this->invoice->stream()); } } diff --git a/public/vendor/invoices/sample-logo.png b/public/vendor/invoices/logo.png similarity index 100% rename from public/vendor/invoices/sample-logo.png rename to public/vendor/invoices/logo.png