feat(email-module): implement Email_Module — send and retry email cron callbacks (#97)#107
Closed
MathieuLamiot wants to merge 7 commits into
Closed
feat(email-module): implement Email_Module — send and retry email cron callbacks (#97)#107MathieuLamiot wants to merge 7 commits into
MathieuLamiot wants to merge 7 commits into
Conversation
#94) Introduces the wp-plugin/modules/ directory with Module_Interface and five empty feature modules (Event, Report, Email, AI, Settings). Sybgo::init() now creates the three managers and boots all modules via build_modules() before delegating to the legacy init_*() sub-methods, which remain intact until each module's boot() is fully implemented in sub-issues #95–#99. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ction Documents the new wp-plugin/modules/ directory and the Module_Interface pattern introduced in #94. Explains where new domain wiring belongs and the boot() registration-only contract. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…API, ability (#95) Moves event tracking init, sybgo_init_api(), and sybgo/track-events ability registration from Sybgo::init_event_tracking() and init_abilities() into Event_Module::boot(). Ability registration is deferred to the 'init' hook at priority 5; Ability_Manager::init() is scheduled at priority 20 so it captures all module-registered abilities. Adds EventModuleTest covering tracker storage, API side-effect, and deferred ability registration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…freeze cron (#96) Moves Dashboard_Widget and Reports_Page registration and the sybgo_freeze_weekly_report cron callback from Sybgo into Report_Module::boot() and the new named freeze_report_callback() method. Removes create_dashboard_widget(), create_reports_page(), and freeze_weekly_report_callback() from class-sybgo.php. Adds ReportModuleTest covering admin page registration, cron wiring, and callback logic for both frozen and no-active-report paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n callbacks (#97) Moves send_report_emails_callback() and retry_failed_emails_callback() from Sybgo into Email_Module as public named methods. Both crons are now registered via CronManager in Email_Module::boot(). EmailModuleTest migrates the #68 regression tests (string-id-to-int cast + no-op path) from the deleted SybgoCronCallbacksTest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ity (#98) AI_Module::boot() defers the sybgo/generate-summary ability registration to the 'init' hook at priority 5 so __() evaluates after the text domain loads. Removes the now-redundant init_abilities() method from Sybgo — both abilities are owned by their respective modules (Event_Module and AI_Module). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Module Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e7d8166 to
6c3b4e4
Compare
Owner
Author
|
Superseded by #112 (correct head branch feat/email-module-97 → develop). |
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.
Description
Email_Module::boot()owns thesybgo_send_report_emailsandsybgo_retry_failed_emailscron registrations. Both callbacks are public named methods (send_report_emails_callback,retry_failed_emails_callback), making them independently testable. The anonymous closure versions inSybgo::init_cron_schedules()are removed.Closes #97
Type of change
Detailed scenario
What was tested
No manual testing performed: this is a pure internal reorganisation. The cron hook names, schedules, and callback logic are identical to what was in
Sybgo. The(int)cast on the report id is preserved as a regression guard for issue #68 ($wpdbreturns string ids;Email_Manager::send_report_email()is strictly typed againstint).Automated coverage: 5 unit tests in
EmailModuleTest— cron registration, callback pointer assertions, the #68 regression test (string id cast), and the no-frozen-report early-return path.How to test
wp cron event run sybgo_send_report_emailsExpected: no PHP type errors; email log updated.
cd wp-plugin && vendor/bin/phpunit --testsuite Unit --filter EmailModuleTestExpected: 5 tests, all green.
Affected Features & Quality Assurance Scope
SybgoCronCallbacksTestremoved; tests migrated toEmailModuleTestTechnical description
Documentation
Both crons are registered via
Cron_Manager::register()insideEmail_Module::boot(). Callback methods are public on the module instance, matching the[$this, 'method_name']pattern established byReport_Module. See wp-plugin/docs/development.md for the Feature Module Architecture overview.New dependencies
None.
Risks
None identified. The
(int)cast regression guard from issue #68 is preserved verbatim.Mandatory Checklist
Code validation
Code style
Unticked items justification
Manual testing not performed: pure internal reorganisation; E2E suite covers email sending end-to-end.
Additional Checks