Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
26 changes: 15 additions & 11 deletions app/Notifications/EventNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
Expand Down
96 changes: 96 additions & 0 deletions resources/views/events/event_registration.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Registration Confirmation</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
margin: 0;
padding: 0;
}
.container {
width: 100%;
max-width: 600px;
margin: 20px auto;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
overflow: hidden;
}
.header {
background-color: #4C50AF;
color: #fff;
text-align: center;
padding: 20px;
font-size: 24px;
font-weight: bold;
}
.logo {
text-align: center;
padding: 10px 0;
}
.logo img {
max-width: 40%;
height: auto;
}
.content {
padding: 30px;
}
.content h1 {
color: #333;
font-size: 22px;
}
.content p {
line-height: 1.6;
}
.button {
display: inline-block;
margin-top: 20px;
padding: 10px 20px;
background-color: #4C50AF;
color: #fff;
text-decoration: none;
font-weight: bold;
border-radius: 4px;
}
.note {
margin-top: 20px;
font-size: 12px;
color: #666;
}
.footer {
background-color: #f4f4f4;
text-align: center;
padding: 15px;
font-size: 12px;
color: #999;
}
</style>
</head>
<body>
<div class="container">
<div class="logo">
<img src="{{ asset('assets/img/logo-dark.png') }}" alt="DevNation Logo">
</div>
<div class="header">
Event registration confirmation
</div>
<div class="content">
<h1>Greetings! {{ $userName }}</h1>
<p>You have successfully registered for the event: <strong>{{ $eventName }}</strong>.</p>
<p>We look forward to seeing you at the event!</p>
<a href="{{ $eventUrl }}" class="button">View Event Details</a>
<p>We look forward to seeing you at the event!</p>
<p>Regards,<br>DevNation</p>
<p class="note">If you're having trouble clicking the "View Event" button, copy and paste the URL below into your web browser: <a href="{{ $eventUrl }}">{{ $eventUrl }}</a></p> <!-- clickable URL -->
</div>
<div class="footer">
&copy; 2024 DevNations | All Rights Reserved
</div>
</div>
</body>
</html>