-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Add notifications for order statuses: cancelled, failed, and re… #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThis PR adds SMS notification support for three additional order statuses (cancelled, failed, refunded) across WooCommerce and Dokan integrations, including nine new notification classes for admin, customer, and vendor recipients, plus integration and registry updates to trigger these notifications. Changes
Sequence DiagramsequenceDiagram
participant Order as Order Status<br/>Change
participant Integration as Integration<br/>(WC/Dokan)
participant Registry as Notifications<br/>Registry
participant Notifier as Notification<br/>Class
participant Recipient as Recipients
Order->>Integration: order_status_changed(cancelled|failed|refunded)
activate Integration
Integration->>Registry: Trigger event (e.g., order_admin_cancelled)
deactivate Integration
activate Registry
Registry->>Notifier: Instantiate Notification Class
Registry->>Recipient: Send to default_recipients
deactivate Registry
Note over Notifier,Recipient: Message sent with<br/>populated variables
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes The changes comprise 12 new files (9 notification classes) and 3 modified integration/registry files. While the new notification classes follow a consistent, repetitive pattern—each defining metadata and a message template in a constructor—reviewers must verify that each class correctly implements its role (admin vs. customer vs. vendor), validate integration trigger logic for the three new statuses, and confirm registry mappings are properly configured. The homogeneity of the notification classes reduces cognitive load, but the spread across multiple files and the need to cross-reference integration logic and messaging content moderately increases review scope. Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (12)
🧰 Additional context used🧬 Code graph analysis (12)includes/Notifications/WC/CancelledCustomer.php (3)
includes/Notifications/WC/RefundedAdmin.php (5)
includes/Integrations/Dokan.php (2)
includes/Notifications/WC/FailedAdmin.php (4)
includes/Notifications/Dokan/FailedVendor.php (3)
includes/Notifications/WC/CancelledAdmin.php (3)
includes/Notifications/Dokan/CancelledVendor.php (4)
includes/Notifications.php (1)
includes/Notifications/WC/RefundedCustomer.php (4)
includes/Notifications/Dokan/RefundedVendor.php (4)
includes/Notifications/WC/FailedCustomer.php (3)
includes/Integrations/WooCommerce.php (2)
🔇 Additional comments (14)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…funded
fix: #50
Summary by CodeRabbit
New Features