diff --git a/Models/Panels/Actions/TrySendMailAction.php b/Models/Panels/Actions/TrySendMailAction.php index 5805c176..8dcbe00e 100755 --- a/Models/Panels/Actions/TrySendMailAction.php +++ b/Models/Panels/Actions/TrySendMailAction.php @@ -10,7 +10,10 @@ use Illuminate\Support\Facades\Mail; use Modules\Notify\Emails\BeautyEmail; +use Modules\Notify\Notifications\Notify; use Modules\Theme\Services\ThemeService; +use Illuminate\Support\Facades\Notification; +use Modules\Notify\Notifications\TestNotification; use Modules\Xot\Models\Panels\Actions\XotBasePanelAction; // -------- bases ----------- @@ -66,7 +69,13 @@ public function postHandle() { */ //$view='notify::emails.welcome'; $view='notify::emails.samples.ark'; - + $test=(object)['a'=>'b']; + $users=[ + new Notify('mail','marco.sottana@gmail.com'), + ]; + + Notification::send($users, new TestNotification($test)); + /* $beautymail = app()->make(BeautyEmail::class); $view_params=$beautymail->getSettings(); @@ -80,6 +89,7 @@ function(\Illuminate\Mail\Message $message) use($data){ ->subject($data['subject']); } ); + */ //*/ diff --git a/Notifications/Notify.php b/Notifications/Notify.php new file mode 100644 index 00000000..205397eb --- /dev/null +++ b/Notifications/Notify.php @@ -0,0 +1,36 @@ +routes[$channel] = $route; + + } + + + /** Get the notification routing information for the given driver. + * + * @param string $driver + * @return mixed + */ + public function routeNotificationFor($driver) + { + return $this->routes[$driver] ?? null; + } + +} \ No newline at end of file diff --git a/Notifications/TestNotification.php b/Notifications/TestNotification.php new file mode 100644 index 00000000..4ec0cca5 --- /dev/null +++ b/Notifications/TestNotification.php @@ -0,0 +1,63 @@ +routes); + // + + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable){ + //dddx($notifiable); + return (new MailMessage) + ->line('The introduction to the notification.') + ->action('Notification Action', 'https://laravel.com') + ->line('Thank you for using our application!'); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable){ + dddx($notifiable); + return [ + // + ]; + } +}