feat(installation): implement post setup job and welcome email functionality#4
Merged
Arsalanulhaq merged 2 commits intomainfrom Jan 26, 2026
Merged
Conversation
97cbe31 to
586ce2d
Compare
There was a problem hiding this comment.
Pull request overview
This pull request implements a post-installation workflow for the NCW Tools app, triggered by the InstallationCompletedEvent. The workflow configures SMTP settings from secure config files, schedules a background job to verify system readiness, and sends a welcome email to the initial admin user.
Changes:
- Added event listener to handle installation completion, configure SMTP settings, and schedule post-setup tasks
- Implemented background job to check system readiness and send welcome email with password reset token
- Added helper class to encapsulate welcome email sending logic
- Created comprehensive unit tests for all new components
- Added test stubs for classes not yet available in the OCP package
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/AppInfo/Application.php | Registers the InstallationCompletedEventListener for the post-install workflow |
| lib/Listeners/InstallationCompletedEventListener.php | Handles installation completion by reading config files and scheduling the PostSetupJob |
| lib/BackgroundJob/PostSetupJob.php | Timed job that verifies system readiness and sends welcome email to admin |
| lib/Helper/WelcomeMailHelper.php | Encapsulates logic for generating and sending welcome emails |
| tests/unit/AppInfo/ApplicationTest.php | Verifies event listener registration in the application bootstrap |
| tests/unit/Listeners/PostInstallEventListenerTest.php | Tests configuration handling, job scheduling, and edge cases |
| tests/unit/BackgroundJob/PostSetupJobTest.php | Tests job execution flow including various status conditions |
| tests/unit/Helper/WelcomeMailHelperTest.php | Tests welcome email sending with and without password reset tokens |
| tests/bootstrap.php | Adds autoloader for test stubs |
| tests/stubs/OCP/Install/Events/InstallationCompletedEvent.php | Stub class for testing when actual OCP class is unavailable |
| composer.json | Configures autoload-dev to include test stubs |
| psalm.xml | Adds test stubs directory to Psalm analysis |
12a73b4 to
874df30
Compare
874df30 to
a2c8b33
Compare
162beb4 to
9651c9b
Compare
printminion-co
requested changes
Jan 22, 2026
Collaborator
printminion-co
left a comment
There was a problem hiding this comment.
review done in PR with fixup commits
Add EditorConfig file to maintain consistent coding styles across different editors and IDEs. Configures indent styles for PHP (tabs), JSON/YAML (spaces), and other file types. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
d22f59b to
edb026c
Compare
…onality Add a new PostSetupJob that sends a welcome email to the admin user after installation completion. This job checks the installation status and ensures the SMTP configuration is set correctly. Additionally, an InstallationCompletedEventListener is introduced to trigger the PostSetupJob upon installation completion. This enhancement improves user onboarding by automating the welcome email process. Signed-off-by: Arsalan Ul Haq Sohni <arsalan-ul-haq.sohni@strato.de>
edb026c to
444034b
Compare
printminion-co
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a post-installation setup workflow for the app, which is triggered after installation is completed. It includes a new event listener for the installation completion event, a background job to handle post-setup tasks (such as sending a welcome email to the admin), a helper for sending the welcome email, and comprehensive unit tests for these new features.
Event-driven post-installation setup:
InstallationCompletedEventListenerto handle theInstallationCompletedEvent, which initializes the admin user, configures SMTP mail settings from secure config files, and schedules thePostSetupJobto run post-install tasks.registermethod inApplication.php. [1] [2]Automated post-setup background job:
PostSetupJob, a timed background job that checks for completion status, verifies system readiness, and sends a welcome email to the initial admin user. The job self-removes after successful execution.WelcomeMailHelperto encapsulate logic for generating and sending the welcome email to the admin user, leveraging existing mail helper infrastructure.Testing and reliability:
PostSetupJobcovering various job states and scenarios (already done, unknown status, pending, URL unreachable, and successful mail send).InstallationCompletedEventListenerto verify correct configuration handling, job scheduling, and edge cases such as quoted config values and missing SMTP security settings.