diff options
author | yehuda <yehuda@myinbox.in> | 2019-03-04 16:44:26 +0200 |
---|---|---|
committer | yehuda <yehuda@myinbox.in> | 2019-03-04 16:44:26 +0200 |
commit | 1c687646231fa31cea77eb3aa994a4a037ce670a (patch) | |
tree | 45e0858a4869f6a082fec91d34666627448f8d54 /Postman/Postman-Configuration/PostmanConfigurationController.php | |
parent | e33f6bd6bce974ec0d9836e1589ea1facf159841 (diff) | |
download | Post-SMTP-1c687646231fa31cea77eb3aa994a4a037ce670a.zip |
* 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/PostmanConfigurationController.php')
-rw-r--r-- | Postman/Postman-Configuration/PostmanConfigurationController.php | 113 |
1 files changed, 113 insertions, 0 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> + + <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> + + <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 ); |