summaryrefslogtreecommitdiff
path: root/Postman/Postman-Configuration
diff options
context:
space:
mode:
Diffstat (limited to 'Postman/Postman-Configuration')
-rw-r--r--Postman/Postman-Configuration/PostmanConfigurationController.php20
-rw-r--r--Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php15
-rw-r--r--Postman/Postman-Configuration/postman_manual_config.js3
-rw-r--r--Postman/Postman-Configuration/postman_wizard.js2
4 files changed, 28 insertions, 12 deletions
diff --git a/Postman/Postman-Configuration/PostmanConfigurationController.php b/Postman/Postman-Configuration/PostmanConfigurationController.php
index ee14ad8..59fbdb8 100644
--- a/Postman/Postman-Configuration/PostmanConfigurationController.php
+++ b/Postman/Postman-Configuration/PostmanConfigurationController.php
@@ -390,17 +390,19 @@ class PostmanConfigurationController {
print '<section id="notifications">';
do_settings_sections( PostmanAdminController::NOTIFICATIONS_OPTIONS );
- $currentKey = $this->options->getNotificationService();
- $pushover = $currentKey == 'pushover' ? 'block' : 'none';
- $slack = $currentKey == 'slack' ? 'block' : 'none';
+ $currentKey = $this->options->getNotificationService();
+ $pushover = $currentKey == 'pushover' ? 'block' : 'none';
+ $slack = $currentKey == 'slack' ? 'block' : 'none';
- echo '<div id="pushover_cred" style="display: ' . $pushover . ';">';
- do_settings_sections( PostmanAdminController::NOTIFICATIONS_PUSHOVER_CRED );
- echo '</div>';
+ echo '<div id="pushover_cred" style="display: ' . $pushover . ';">';
+ do_settings_sections( PostmanAdminController::NOTIFICATIONS_PUSHOVER_CRED );
+ echo '</div>';
- echo '<div id="slack_cred" style="display: ' . $slack . ';">';
- do_settings_sections( PostmanAdminController::NOTIFICATIONS_SLACK_CRED );
- echo '</div>';
+ echo '<div id="slack_cred" style="display: ' . $slack . ';">';
+ do_settings_sections( PostmanAdminController::NOTIFICATIONS_SLACK_CRED );
+ echo '</div>';
+
+ do_action( 'post_smtp_notification_settings' );
print '</section>';
diff --git a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
index 6ddebd7..705ef23 100644
--- a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
+++ b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
@@ -234,6 +234,7 @@ class PostmanSettingsRegistry {
'notification_chrome_uid_callback',
), PostmanAdminController::NOTIFICATIONS_OPTIONS, PostmanAdminController::NOTIFICATIONS_SECTION );
+ do_action( 'post_smtp_settings' );
}
}
@@ -443,12 +444,20 @@ class PostmanSettingsRegistry {
public function notification_service_callback() {
$inputDescription = __( 'Select the notification service you want to recieve alerts about failed emails.' );
+
+ $options = apply_filters('post_smtp_notification_service', array(
+ 'default' => __( 'WP Admin Email', 'post-smtp' ),
+ 'pushover' => __( 'Pushover', 'post-smtp' ),
+ 'slack' => __( 'Slack', 'post-smtp' ),
+ ));
+
printf( '<select id="input_%2$s" class="input_%2$s" name="%1$s[%2$s]">', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_SERVICE );
$currentKey = $this->options->getNotificationService();
- $this->printSelectOption( __( 'Email', 'post-smtp' ), 'default', $currentKey );
- $this->printSelectOption( __( 'Pushover', 'post-smtp' ), 'pushover', $currentKey );
- $this->printSelectOption( __( 'Slack', 'post-smtp' ), 'slack', $currentKey );
+ foreach ( $options as $key => $label ) {
+ $this->printSelectOption( $label, $key, $currentKey );
+ }
+
printf( '</select><br/><span class="postman_input_description">%s</span>', $inputDescription );
}
diff --git a/Postman/Postman-Configuration/postman_manual_config.js b/Postman/Postman-Configuration/postman_manual_config.js
index a47df1a..49438fc 100644
--- a/Postman/Postman-Configuration/postman_manual_config.js
+++ b/Postman/Postman-Configuration/postman_manual_config.js
@@ -40,6 +40,9 @@ jQuery(document).ready(
$('#pushover_cred').fadeOut('fast');
$('#slack_cred').fadeIn();
}
+
+ Hook.call( 'post_smtp_notification_change', selected );
+
});
diff --git a/Postman/Postman-Configuration/postman_wizard.js b/Postman/Postman-Configuration/postman_wizard.js
index d844322..cbd2031 100644
--- a/Postman/Postman-Configuration/postman_wizard.js
+++ b/Postman/Postman-Configuration/postman_wizard.js
@@ -517,6 +517,8 @@ function handleConfigurationResponse(response) {
jQuery('#pushover_cred').fadeOut('fast');
jQuery('#slack_cred').fadeIn();
}
+
+ Hook.call( 'post_smtp_notification_change', selected );
});
// add an event on the user port override field