RegistrationService
in package
Handles notifications for event registrations.
Persistence is owned by the controller (persist-first, so a registration is never lost on email failure); this service resolves the admin recipient from configuration and delivers the admin notification plus an optional registrant confirmation using the CMS email Sender.
Configuration lives under the events.registration section:
notify_email recipient for admin notifications (falls back to email.from_address)
confirmation_enabled send a confirmation email to the registrant (default: false)
success_message thank-you message shown after registering
Table of Contents
Properties
- $_basePath : string
- $_sender : Sender|null
- $_settings : SettingManager
Methods
- __construct() : mixed
- getNotifyEmail() : string|null
- Resolve the admin notification recipient.
- getSuccessMessage() : string
- The thank-you message shown after a successful registration.
- isConfirmationEnabled() : bool
- Whether a confirmation email should be sent to the registrant.
- notifyAdmin() : bool
- Notify the configured admin recipient of a new registration.
- sendConfirmation() : bool
- Send a confirmation email to the registrant when enabled.
- buildAdminPlainBody() : string
- Plain-text admin body fallback.
- buildConfirmationPlainBody() : string
- Plain-text confirmation body fallback.
- getRegistrationSetting() : mixed
- Read a value from the events.registration config section.
Properties
$_basePath
private
string
$_basePath
$_sender
private
Sender|null
$_sender
$_settings
private
SettingManager
$_settings
Methods
__construct()
public
__construct(SettingManager $settings[, Sender|null $sender = null ][, string|null $basePath = null ]) : mixed
Parameters
- $settings : SettingManager
- $sender : Sender|null = null
-
Optional Sender (injectable for testing)
- $basePath : string|null = null
-
Base path for email template resolution
getNotifyEmail()
Resolve the admin notification recipient.
public
getNotifyEmail() : string|null
Return values
string|null —Null when no recipient can be determined
getSuccessMessage()
The thank-you message shown after a successful registration.
public
getSuccessMessage() : string
Return values
stringisConfirmationEnabled()
Whether a confirmation email should be sent to the registrant.
public
isConfirmationEnabled() : bool
Return values
boolnotifyAdmin()
Notify the configured admin recipient of a new registration.
public
notifyAdmin(EventRegistration $registration, Event $event) : bool
Parameters
- $registration : EventRegistration
- $event : Event
Return values
bool —True when the email was sent (or logged in test/log mode)
sendConfirmation()
Send a confirmation email to the registrant when enabled.
public
sendConfirmation(EventRegistration $registration, Event $event) : bool
Parameters
- $registration : EventRegistration
- $event : Event
Return values
bool —True when sent (or skipped because confirmations are disabled)
buildAdminPlainBody()
Plain-text admin body fallback.
private
buildAdminPlainBody(EventRegistration $registration, Event $event) : string
Parameters
- $registration : EventRegistration
- $event : Event
Return values
stringbuildConfirmationPlainBody()
Plain-text confirmation body fallback.
private
buildConfirmationPlainBody(EventRegistration $registration, Event $event) : string
Parameters
- $registration : EventRegistration
- $event : Event
Return values
stringgetRegistrationSetting()
Read a value from the events.registration config section.
private
getRegistrationSetting(string $key) : mixed
Parameters
- $key : string