adachsoft / reminder
Framework-independent reminder lifecycle and notification scheduling for PHP applications.
Requires
- php: ^8.3
- adachsoft/action-contracts: ^0.1
- adachsoft/automation-contracts: ^0.1
- adachsoft/notification-contracts: ^0.1
- adachsoft/principal-contracts: ^0.2
- adachsoft/recurrence-contracts: ^0.1
- adachsoft/reference-contracts: ^0.1
- adachsoft/reminder-contracts: ^0.1
- psr/clock: ^1.0
Requires (Dev)
- adachsoft/action: ^0.1
- adachsoft/automation: ^0.1
- adachsoft/notification: ^0.1
- adachsoft/php-code-style: ^0.7.3
- adachsoft/recurrence: ^0.1
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^13.4
- rector/rector: ^2.8
- symplify/phpstan-rules: ^14.19
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
adachsoft/reminder is a framework-independent PHP library for managing recurring reminders addressed to people, accounts, or groups. It provides reminder lifecycle operations, access policies, acknowledgement tracking, and integration points for scheduled notifications.
Features
- Create, update, enable, disable, and delete reminders.
- Use recurrence rules and optional repeat-until-acknowledged policies.
- Resolve recipient groups and avoid notifying recipients who have acknowledged an occurrence.
- Synchronize reminder schedules and clean up related schedules when reminders are deleted.
- Integrate through repository, principal, notification, scheduling, and clock contracts.
Requirements and installation
Requires PHP 8.3 or newer and Composer.
composer require adachsoft/reminder
The library depends on contracts; applications provide persistent repository adapters and implementations of principal resolution, notifications, scheduling, and Psr\Clock\ClockInterface. For the AdachSoft automation, action, recurrence, and notification implementations, install their packages in your application:
composer require adachsoft/automation adachsoft/action adachsoft/recurrence adachsoft/notification
Usage
Use ReminderServiceFactory::create() to construct the reminder service from your repository and infrastructure implementations. Use ReminderServiceFactory::createAutomationComponents() to connect reminder delivery to an automation schedule, action executor, and notification dispatcher. Invoke the automation tick from your application's worker. Keep the same repository instances and clock throughout the integration.
The detailed end-to-end example demonstrates setup, delivery, acknowledgement, repeat scheduling, and cleanup: