A complete Drupal 10 custom module for event registration management, featuring admin configuration, public registration forms with AJAX-dependent dropdowns, email notifications, and CSV export.
- Admin Event Configuration: Create and manage events with dates, categories, and registration periods
- Public Registration Form: AJAX-powered dependent dropdowns (Category → Date → Event)
- Access Control: Registration form only accessible during active registration periods
- Duplicate Prevention: Prevents duplicate registrations by email + event date
- Email Notifications: Confirmation emails to participants and optional admin notifications
- Admin Reports: Filterable registration listing with participant count and CSV export
- Custom Permissions: Granular access control for admin functions
- Drupal 10.x
- PHP 8.1 or 8.2
- MySQL 8.0+ or MariaDB 10.4+
- Composer
-
Clone the repository:
git clone https://github.com/ashwin-r11/drupal10-event-registration.git cd drupal10-event-registration -
Start the Docker environment:
docker compose up -d
-
Wait for containers to be ready, then install Drupal:
docker compose exec drupal drush site:install standard \ --db-url=mysql://drupal:drupal@db:3306/drupal \ --account-name=admin \ --account-pass=admin \ --site-name="Event Registration" \ -y
-
Enable the module:
docker compose exec drupal drush en event_registration -y docker compose exec drupal drush cr
-
Access the site at: http://localhost:8080
-
Copy the module to your Drupal installation:
cp -r web/modules/custom/event_registration /path/to/drupal/web/modules/custom/
-
Enable the module:
drush en event_registration -y drush cr
| Path | Description | Access |
|---|---|---|
/admin/config/event-registration/settings |
Module settings (admin email) | Admin |
/admin/config/event-registration/add-event |
Add new event | Admin |
/register |
Public registration form | Public (date-restricted) |
/admin/reports/event-registrations |
Registration report | Admin |
/admin/reports/event-registrations/export |
CSV export | Admin |
Stores event definitions created by administrators.
| Column | Type | Description |
|---|---|---|
id |
INT (PK) | Auto-increment ID |
registration_start_date |
DATE | When registration opens |
registration_end_date |
DATE | When registration closes |
event_date |
DATE | Actual event date |
event_name |
VARCHAR(255) | Event title |
category |
VARCHAR(64) | Event category (online_workshop, hackathon, conference, one_day_workshop) |
Stores participant registrations.
| Column | Type | Description |
|---|---|---|
id |
INT (PK) | Auto-increment ID |
full_name |
VARCHAR(255) | Participant name |
email |
VARCHAR(255) | Participant email |
college |
VARCHAR(255) | College name |
department |
VARCHAR(255) | Department |
event_id |
INT (FK) | Reference to event_configurations.id |
created |
INT | Unix timestamp of registration |
Unique Constraint: email + event_id (prevents duplicate registrations)
- Required Fields: All fields are required
- Email Format: Standard email validation (
filter_var+ regex) - Special Characters: Text fields (name, college, department) disallow special characters. Only letters, numbers, spaces, hyphens, and apostrophes allowed.
- Duplicate Prevention: System checks if email is already registered for the selected event
- Date-Based Access: Form only accessible when current date is between
registration_start_dateandregistration_end_date
- Date Order: Registration end date must be after start date
- Event Date: Must be after registration end date
- Required Fields: All fields mandatory
The registration form uses AJAX for dependent field updates:
- Category Selection → Updates Event Date dropdown (shows dates with events in that category)
- Event Date Selection → Updates Event Name dropdown (shows events on that date in selected category)
Sent automatically after successful registration:
- Recipient: Participant email
- Content: Name, event details, category, date
Configurable at /admin/config/event-registration/settings:
- Enable/disable admin notifications
- Set admin email address
- Content: Full registration details
Note: In Docker development, emails are logged but not delivered (no mail server). Check logs at /admin/reports/dblog.
| Permission | Description |
|---|---|
administer event registration |
Full access to all admin functions |
Assign to roles at /admin/people/permissions.
Module settings are stored using Drupal's Config API:
# config/install/event_registration.settings.yml
admin_notification_email: 'admin@example.com'
enable_admin_notifications: trueExport/import with:
drush config:export
drush config:importThe repository includes a CI workflow that validates:
- ✓ Drupal installs successfully
- ✓ Module enables without errors
- ✓ Database tables are created
- ✓ Routes are registered
Runs automatically on push/PR to main branch.
docker compose exec drupal drush crdocker compose exec drupal drush watchdog:show --count=20docker compose exec drupal drush sqlq "SELECT * FROM event_configurations;"docker compose exec drupal drush sqlq "SELECT * FROM event_registrations;"web/modules/custom/event_registration/
├── config/
│ ├── install/
│ │ └── event_registration.settings.yml
│ └── schema/
│ └── event_registration.schema.yml
├── src/
│ ├── Access/
│ │ └── RegistrationAccessCheck.php
│ ├── Controller/
│ │ └── RegistrationReportController.php
│ ├── Form/
│ │ ├── EventAddForm.php
│ │ ├── EventSettingsForm.php
│ │ └── RegistrationForm.php
│ └── Service/
│ └── EventRegistrationRepository.php
├── event_registration.info.yml
├── event_registration.install
├── event_registration.links.menu.yml
├── event_registration.module
├── event_registration.permissions.yml
├── event_registration.routing.yml
├── event_registration.services.yml
└── event_registration.sql
Detailed documentation is available in the /docs directory:
| Document | Description |
|---|---|
| ARCHITECTURE.md | Module architecture and design patterns |
| FORMS.md | Detailed form documentation |
| DATABASE.md | Database schema and queries |
| API.md | Service API reference |
| TROUBLESHOOTING.md | Common issues and solutions |
This project is provided as-is for educational and demonstration purposes.





