@@ -624,6 +624,31 @@ Handles plugin activation, deactivation, and lifecycle.
624624| ` uninstall() ` | ` void ` | Plugin uninstallation handler |
625625| ` create_tables() ` | ` void ` | Create database tables |
626626
627+ ### Config\Settings
628+
629+ Plugin settings management with singleton pattern.
630+
631+ ``` php
632+ use SilverAssist\ContactFormToAPI\Config\Settings;
633+
634+ $settings = Settings::instance();
635+ $is_enabled = $settings->is_alerts_enabled();
636+ ```
637+
638+ #### Methods
639+
640+ | Method | Return | Description |
641+ | --------| --------| -------------|
642+ | ` instance() ` | ` Settings ` | Get singleton instance |
643+ | ` get(string $key, $default) ` | ` mixed ` | Get setting value |
644+ | ` set(string $key, $value) ` | ` bool ` | Set setting value |
645+ | ` is_alerts_enabled() ` | ` bool ` | Check if alerts are enabled globally |
646+ | ` get_alert_types() ` | ` array ` | Get alert types configuration (since 2.1.0) |
647+ | ` is_threshold_alerts_enabled() ` | ` bool ` | Check if threshold alerts are enabled (since 2.1.0) |
648+ | ` is_individual_alerts_enabled() ` | ` bool ` | Check if individual alerts are enabled (since 2.1.0) |
649+ | ` get_alert_recipients() ` | ` string ` | Get comma-separated alert recipients |
650+ | ` is_encryption_enabled() ` | ` bool ` | Check if encryption is enabled |
651+
627652### Service\Logging\LogWriter
628653
629654Create and update log entries.
@@ -743,6 +768,45 @@ $encrypted = $encryption->encrypt($data);
743768$decrypted = $encryption->decrypt($encrypted);
744769```
745770
771+ ### Service\Notification\EmailAlertService
772+
773+ Email alert service for monitoring API errors.
774+
775+ ** Since** : 1.3.0 (Individual alerts added in 2.1.0)
776+
777+ ``` php
778+ use SilverAssist\ContactFormToAPI\Service\Notification\EmailAlertService;
779+
780+ $alerts = EmailAlertService::instance();
781+ $alerts->check_and_alert(); // Threshold-based alerts
782+ $alerts->maybe_send_individual_alert($log_id, $form_id); // Individual failure alerts
783+ ```
784+
785+ #### Methods
786+
787+ | Method | Return | Description |
788+ | --------| --------| -------------|
789+ | ` instance() ` | ` EmailAlertService ` | Get singleton instance |
790+ | ` check_and_alert() ` | ` void ` | Check error rates and send threshold alerts |
791+ | ` maybe_send_individual_alert(int $log_id, int $form_id) ` | ` void ` | Send individual failure alert if enabled (since 2.1.0) |
792+
793+ #### Individual Failure Alerts
794+
795+ Individual failure alerts (added in 2.1.0) notify administrators immediately when a submission permanently fails after exhausting all retries.
796+
797+ ** Features** :
798+ - Event-driven (no cooldown like threshold alerts)
799+ - Privacy-first: emails contain only error metadata, never user-submitted form data
800+ - Spam prevention: transient flag per log_id prevents duplicate alerts
801+
802+ ** Alert email includes** :
803+ - Site name and form title
804+ - API endpoint URL
805+ - Timestamp
806+ - HTTP response code
807+ - Error message
808+ - Link to view full log details
809+
746810### Controller\ContactForm\SubmissionController
747811
748812CF7 submission controller handling hook registration.
@@ -993,6 +1057,6 @@ class LoggingServiceTest extends TestCase {
9931057
9941058---
9951059
996- ** Document Version** : 2.0 .0
997- ** Last Updated** : January 25 , 2026
1060+ ** Document Version** : 2.1 .0
1061+ ** Last Updated** : January 26 , 2026
9981062** Maintained By** : Silver Assist Development Team
0 commit comments