Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User should recieve a mail notification on event registeration #128 #213

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
305abc3
Email notification sending with Test Event and Test name working.
Oct 13, 2024
f614c26
Email notification sending with Test Event and Test name changed for …
Oct 13, 2024
a6d869c
email notification when user is registrating to event is working
Nov 2, 2024
b708a29
deleting an unused file
Nov 3, 2024
6f6ebb0
Removed and updated files for registration
Nov 3, 2024
fbd075e
Merge remote-tracking branch 'upstream/main'
LKyz24 Nov 12, 2024
772bb1a
modification of templates for mail
LKyz24 Nov 16, 2024
f28eb6a
added UserNotificationTest and AuthTest
LKyz24 Nov 17, 2024
3cde039
Create main.yml
LKyz24 Nov 29, 2024
ac66782
Updated main.yml
LKyz24 Nov 29, 2024
17d4e1f
Update main.yml
LKyz24 Nov 29, 2024
30ea3bd
Update main.yml
LKyz24 Nov 29, 2024
958158b
Merge pull request #1 from LKyz24/tests
LKyz24 Nov 29, 2024
277061a
Update main.yml
LKyz24 Nov 29, 2024
de9ac92
Update main.yml
LKyz24 Nov 29, 2024
3ce4d9d
Update main.yml
LKyz24 Nov 29, 2024
ea806eb
Update main.yml
LKyz24 Nov 29, 2024
7d4a74f
Update main.yml
LKyz24 Nov 29, 2024
8e07a13
Update main.yml
LKyz24 Nov 29, 2024
1f99242
Update main.yml
LKyz24 Nov 29, 2024
ce5c05b
Added event_type for successfull test
LKyz24 Nov 29, 2024
4fe91f8
Merge pull request #2 from LKyz24/tests
LKyz24 Nov 29, 2024
40b42b8
success event test
LKyz24 Nov 29, 2024
31c8744
tests
LKyz24 Nov 29, 2024
66b6fdf
Merge pull request #3 from LKyz24/tests
LKyz24 Nov 29, 2024
b9ea8a3
conference name change in test
LKyz24 Nov 29, 2024
dd913e3
Merge pull request #4 from LKyz24/tests
LKyz24 Nov 29, 2024
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
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: DevNation-CMS CI

on:
push:
branches:
- main
- feature/*
pull_request:

jobs:
build_and_test:
name: Build & Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'

- name: Install dependencies
run: composer install

- name: Create .env file from .env.example
run: cp .env.example .env || echo "APP_KEY=base64:$(openssl rand -base64 32)" > .env

- name: Generate application key
run: php artisan key:generate

- name: Create SQLite database
run: |
touch database/database.sqlite

- name: Run migrations
run: php artisan migrate --env=testing

- name: Run tests
run: php artisan test

- name: Clear cache
run: php artisan config:clear && php artisan cache:clear
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>
Loading