diff --git a/app/Filament/Resources/EventRegisteraionResource/Pages/CreateEventRegisteraion.php b/app/Filament/Resources/EventRegisteraionResource/Pages/CreateEventRegisteraion.php index e65b7fb..770f425 100644 --- a/app/Filament/Resources/EventRegisteraionResource/Pages/CreateEventRegisteraion.php +++ b/app/Filament/Resources/EventRegisteraionResource/Pages/CreateEventRegisteraion.php @@ -3,10 +3,12 @@ namespace App\Filament\Resources\EventRegisteraionResource\Pages; use App\Filament\Resources\EventRegisteraionResource; +use App\Notifications\EventNotification; use Filament\Actions; use Filament\Resources\Pages\CreateRecord; class CreateEventRegisteraion extends CreateRecord { protected static string $resource = EventRegisteraionResource::class; + } diff --git a/app/Notifications/EventNotification.php b/app/Notifications/EventNotification.php index 8e70fd7..ce35dc7 100644 --- a/app/Notifications/EventNotification.php +++ b/app/Notifications/EventNotification.php @@ -17,12 +17,14 @@ class EventNotification extends Notification protected $event; protected $registeration; - public function __construct( $event, $registeration ) + + // Constructor for submission to give events and registration + public function __construct($event, $registeration) { $this->event = $event; $this->registeration = $registeration; } - + /** * Get the notification's delivery channels. * @@ -36,17 +38,19 @@ public function via(object $notifiable): array /** * Get the mail representation of the notification. */ + // Email design using HTML public function toMail(object $notifiable): MailMessage { - return (new MailMessage) - ->subject('Event Registration Successful') - ->greeting('Greetings! ' . $notifiable->name) - ->line('Your registration for the event'. $this->event->name .' has been successfully completed.') - ->line('status of your registeration for the '. $this->event->name .' is ' . $this->registeration->status .'') - ->line('We look forward to your esteemed presence at the event.') - ->action('View Event', url('/event-details/' . $this->event->id)) - ->line('Thank you for completing your registration!'); - } + //Returning MailMessage with HTML code + return (new MailMessage) + ->subject('Event Registration Successful') + ->view('events.event_registration', [ + 'userName' => $notifiable->name, + 'eventName' => $this->event->name, + 'registrationStatus' => $this->registeration->status, + 'eventUrl' => url('/event-details/' . $this->event->id), + ]); +} /** * Get the array representation of the notification. diff --git a/resources/views/events/event_registration.blade.php b/resources/views/events/event_registration.blade.php new file mode 100644 index 0000000..4e34941 --- /dev/null +++ b/resources/views/events/event_registration.blade.php @@ -0,0 +1,96 @@ + + + + + + Event Registration Confirmation + + + +
+ +
+ Event registration confirmation +
+
+

Greetings! {{ $userName }}

+

You have successfully registered for the event: {{ $eventName }}.

+

We look forward to seeing you at the event!

+ View Event Details +

We look forward to seeing you at the event!

+

Regards,
DevNation

+

If you're having trouble clicking the "View Event" button, copy and paste the URL below into your web browser: {{ $eventUrl }}

+
+ +
+ +