// app/Notifications/TestNotification.php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use RiseTechApps\Notify\Contracts\MessageContract;
use RiseTechApps\Notify\Message\MessageNotify;
class TestNotification extends Notification
{
use Queueable;
public function via(object $notifiable): array
{
return ['notify'];
}
public function toNotify($notifiable): MessageContract
{
return (new MessageNotify($notifiable))
->notifyEmail()
->subject('Test Notification')
->action('https://globo.com', 'Acessar Link')
->to('[email protected]', 'Nome do Usuário')
->line('Esta é uma notificação de teste.')
->subjectMessage('Cabeçalho da Mensagem')
->theme('default')
->content([])
->send();
}
}
// app/Notifications/TestNotification.php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use RiseTechApps\Notify\Contracts\MessageContract;
use RiseTechApps\Notify\Message\MessageNotify;
class TestNotification extends Notification
{
use Queueable;
public function via(object $notifiable): array
{
return ['notify'];
}
public function toNotify($notifiable): MessageContract
{
return (new MessageNotify($notifiable))
->notifyEmail()
->subject('Test Notification')
->action('https://globo.com', 'Acessar Link')
->to('[email protected]', 'Nome do Usuário')
->line('Esta é uma notificação de teste.')
->subjectMessage('Cabeçalho da Mensagem')
->theme('default')
->attachFromUrl($links)
->content([])
->send();
}
}
// RiseTechApps/AuthService/Notifications/Token/TokenSecuritySMS.php
namespace RiseTechApps\AuthService\Notifications\Token;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
use RiseTechApps\Notify\Contracts\MessageContract;
use RiseTechApps\Notify\Message\MessageNotify;
class TokenSecuritySMS extends Notification implements ShouldQueue
{
use Queueable;
protected string|int $token;
public function __construct(string|int $token)
{
$this->token = $token;
}
public function via($notifiable): array
{
return ['notify'];
}
public function toNotify($notifiable): MessageContract
{
return (new MessageNotify($notifiable))
->notifySMS()
->setMessage(__('Use o código para validar sua autenticação: ' . $this->token))
->send();
}
}