summaryrefslogtreecommitdiff
path: root/Postman/Postman-Configuration
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-02-17 20:56:03 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-02-17 20:56:03 +0000
commitf627e0d82c18a1ed60eead38ce38746ded43adc6 (patch)
tree0a3ef3c2266b717a3880c0c4c6edcdc3aae7c275 /Postman/Postman-Configuration
parenta04f57be50a9ce581d8a48acd817d2788958a1dd (diff)
downloadPost-SMTP-f627e0d82c18a1ed60eead38ce38746ded43adc6.zip
= 1.9.7 - 2019-02-17
* New: Fallback Feature - Configure a backup SMTP when emails are failing. * New: WordPress Multisite compability - with global settings. * New: Email Log capability - give other user cheking the logs. * Fixed: compatibility with mailster plugin * Fixed: Mandrill exception bug - Thanks to Niels de Blaauw from Level-Level
Diffstat (limited to 'Postman/Postman-Configuration')
-rw-r--r--Postman/Postman-Configuration/PostmanConfigurationController.php113
-rw-r--r--Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php6
2 files changed, 117 insertions, 2 deletions
diff --git a/Postman/Postman-Configuration/PostmanConfigurationController.php b/Postman/Postman-Configuration/PostmanConfigurationController.php
index 208fa0b..1e5b0a3 100644
--- a/Postman/Postman-Configuration/PostmanConfigurationController.php
+++ b/Postman/Postman-Configuration/PostmanConfigurationController.php
@@ -197,14 +197,18 @@ class PostmanConfigurationController {
PostmanViewController::outputChildPageHeader( __( 'Settings', Postman::TEXT_DOMAIN ), 'advanced_config' );
print '<div id="config_tabs"><ul>';
print sprintf( '<li><a href="#account_config">%s</a></li>', __( 'Account', Postman::TEXT_DOMAIN ) );
+ print sprintf( '<li><a href="#fallback">%s</a></li>', __( 'Fallback', Postman::TEXT_DOMAIN ) );
print sprintf( '<li><a href="#message_config">%s</a></li>', __( 'Message', Postman::TEXT_DOMAIN ) );
print sprintf( '<li><a href="#logging_config">%s</a></li>', __( 'Logging', Postman::TEXT_DOMAIN ) );
print sprintf( '<li><a href="#advanced_options_config">%s</a></li>', __( 'Advanced', Postman::TEXT_DOMAIN ) );
print sprintf( '<li><a href="#notifications">%s</a></li>', __( 'Notifications', Postman::TEXT_DOMAIN ) );
print '</ul>';
+
print '<form method="post" action="options.php">';
// This prints out all hidden setting fields
settings_fields( PostmanAdminController::SETTINGS_GROUP_NAME );
+
+ // account_config
print '<section id="account_config">';
if ( sizeof( PostmanTransportRegistry::getInstance()->getTransports() ) > 1 ) {
do_settings_sections( 'transport_options' );
@@ -230,6 +234,115 @@ class PostmanConfigurationController {
do_settings_sections( PostmanMailgunTransport::MAILGUN_AUTH_OPTIONS );
print '</div>';
print '</section>';
+ // end account config
+ ?>
+
+ <!-- Fallback Start -->
+ <section id="fallback">
+ <h2><?php esc_html_e( 'Failed emails fallback', Postman::TEXT_DOMAIN ); ?></h2>
+ <p><?php esc_html_e( 'By enable this option, if your email is fail to send Post SMTP will try to use the SMTP service you define here.', Postman::TEXT_DOMAIN ); ?></p>
+ <table class="form-table">
+ <tr valign="">
+ <th scope="row"><?php _e( 'Use Fallback?', Postman::TEXT_DOMAIN ); ?></th>
+ <td>
+ <label>
+ <input name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_ENABLED; ?>]" type="radio"
+ value="no"<?php echo checked( $this->options->getFallbackIsEnabled(), 'no' ); ?>>
+ <?php _e( 'No', Postman::TEXT_DOMAIN ); ?>
+ </label>
+ &nbsp;
+ <label>
+ <?php $checked = checked( $this->options->getFallbackIsEnabled(), 'yes', false ); ?>
+ <input name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_ENABLED; ?>]" type="radio"
+ value="yes"<?php echo checked( $this->options->getFallbackIsEnabled(), 'yes' ); ?>>
+ <?php _e( 'Yes', Postman::TEXT_DOMAIN ); ?>
+ </label>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php _e('Outgoing Mail Server', Postman::TEXT_DOMAIN ); ?></th>
+ <?php $host = $this->options->getFallbackHostname(); ?>
+ <td>
+ <input type="text" id="fallback-smtp-host" name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_HOSTNAME; ?>]"
+ value="<?php echo $host; ?>" placeholder="Example: smtp.host.com">
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php _e('Mail Server Port', Postman::TEXT_DOMAIN ); ?></th>
+ <?php $port = $this->options->getFallbackPort(); ?>
+ <td>
+ <input type="number" id="fallback-smtp-port" name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_PORT; ?>]"
+ value="<?php echo $port; ?>" placeholder="Example: 587">
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php _e('Security', Postman::TEXT_DOMAIN ); ?></th>
+ <?php
+ $security_options = array(
+ 'none' => __( 'None', Postman::TEXT_DOMAIN ),
+ 'ssl' => __( 'SSL', Postman::TEXT_DOMAIN ),
+ 'tls' => __( 'TLS', Postman::TEXT_DOMAIN ),
+ );
+ ?>
+ <td>
+ <select id="fallback-smtp-security" name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_SECURITY; ?>]">
+ <?php
+ foreach ( $security_options as $key => $label ) {
+ $selected = selected( $this->options->getFallbackSecurity(), $key,false );
+ ?>
+ <option value="<?php echo $key; ?>"<?php echo $selected; ?>><?php echo $label; ?></option>
+ <?php
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+
+ <tr valign="">
+ <th scope="row"><?php _e( 'Use SMTP Authentication?', Postman::TEXT_DOMAIN ); ?></th>
+ <td>
+ <label>
+ <input name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_USE_AUTH; ?>]"
+ type="radio" value="none"<?php checked( $this->options->getFallbackAuth(), 'none' ); ?>>
+ <?php _e( 'No', Postman::TEXT_DOMAIN ); ?>
+ </label>
+ &nbsp;
+ <label>
+ <input name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_USE_AUTH; ?>]"
+ type="radio" value="login"<?php checked( $this->options->getFallbackAuth(), 'login' ); ?>>
+ <?php _e( 'Yes', Postman::TEXT_DOMAIN ); ?>
+ </label>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php _e('User name', Postman::TEXT_DOMAIN ); ?></th>
+ <td>
+ <input type="text" id="fallback-smtp-username"
+ value="<?php echo $this->options->getFallbackUsername(); ?>"
+ name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_USERNAME; ?>]"
+ >
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php _e('Password', Postman::TEXT_DOMAIN ); ?></th>
+ <td>
+ <input type="password" id="fallback-smtp-password"
+ value="<?php echo PostmanUtils::obfuscatePassword( $this->options->getFallbackPassword() ); ?>"
+ name="postman_options[<?php echo PostmanOptions::FALLBACK_SMTP_PASSWORD; ?>]"
+ >
+ </td>
+ </tr>
+
+ </table>
+ </section>
+ <!-- Fallback End -->
+
+ <?php
print '<section id="message_config">';
do_settings_sections( PostmanAdminController::MESSAGE_SENDER_OPTIONS );
do_settings_sections( PostmanAdminController::MESSAGE_FROM_OPTIONS );
diff --git a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
index 6102d10..7882d43 100644
--- a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
+++ b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
@@ -21,7 +21,7 @@ class PostmanSettingsRegistry {
// only administrators should be able to trigger this
if ( PostmanUtils::isAdmin() ) {
- $sanitizer = new PostmanInputSanitizer();
+ $sanitizer = new PostmanInputSanitizer();
register_setting( PostmanAdminController::SETTINGS_GROUP_NAME, PostmanOptions::POSTMAN_OPTIONS, array(
$sanitizer,
'sanitize',
@@ -101,6 +101,8 @@ class PostmanSettingsRegistry {
'headers_callback',
), PostmanAdminController::MESSAGE_HEADERS_OPTIONS, PostmanAdminController::MESSAGE_HEADERS_SECTION );
+ // Fallback
+
// the Email Validation section
add_settings_section( PostmanAdminController::EMAIL_VALIDATION_SECTION, __( 'Validation', Postman::TEXT_DOMAIN ), array(
$this,
@@ -431,7 +433,7 @@ class PostmanSettingsRegistry {
}
public function notification_chrome_uid_callback() {
- printf( '<input type="password" id="input_%2$s" class="input_%2$s" name="%1$s[%2$s]" value="%3$s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_CHROME_UID, $this->options->getNotificationChromeUid() );
+ printf( '<input type="password" id="input_%2$s" class="input_%2$s" name="%1$s[%2$s]" value="%3$s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_CHROME_UID, PostmanUtils::obfuscatePassword( $this->options->getNotificationChromeUid() ) );
}
public function pushover_user_callback() {