namespace App\Notifications;
use Illuminate\Notifications\Notification;
use NotificationChannels\WhatsApp\Component;
use NotificationChannels\WhatsApp\WhatsAppChannel;
use NotificationChannels\WhatsApp\WhatsAppTemplate;
class MovieTicketPaid extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [WhatsAppChannel::class];
}
public function toWhatsapp($notifiable)
{
return WhatsAppTemplate::create()
->name('sample_movie_ticket_confirmation') // Name of your configured template
->header(Component::image('https://lumiere-a.akamaihd.net/v1/images/image_c671e2ee.jpeg'))
->body(Component::text('Star Wars'))
->body(Component::dateTime(new \DateTimeImmutable))
->body(Component::text('Star Wars'))
->body(Component::text('5'))
->buttons(Component::quickReplyButton(['Thanks for your reply!']))
->buttons(Component::urlButton(['reply/01234'])) // List of url suffixes
->to('34676010101');
}
}
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use NotificationChannels\WhatsApp\Component;
use NotificationChannels\WhatsApp\WhatsAppChannel;
use NotificationChannels\WhatsApp\WhatsAppTextMessage;
class MovieTicketPaid extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [WhatsAppChannel::class];
}
public function toWhatsapp($notifiable)
{
return WhatsAppTextMessage::create()
->message('Hello, this is a test message')
->to('34676010101');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.