summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2020-08-11 20:24:30 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2020-08-11 20:24:30 +0000
commitdf4cdf1cbae42de7b279f474e2b27fa719a90429 (patch)
tree9bdf52d80241502ab7f7b1f81240eb83b8df0be4 /Postman/Postman-Mail
parent53b2035def91dc0fe6d8f68e4a34aca2acc79ec8 (diff)
downloadPost-SMTP-df4cdf1cbae42de7b279f474e2b27fa719a90429.zip
* Fixed: WordPress 5.5 compatibility
* Fixed: Email log filtering * Fixed: Pushover notifications * New: Suggest solution for email delivery errors
Diffstat (limited to 'Postman/Postman-Mail')
-rw-r--r--Postman/Postman-Mail/PostmanWooCommerce.php118
-rw-r--r--Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/OptionsResolver.php6
2 files changed, 18 insertions, 106 deletions
diff --git a/Postman/Postman-Mail/PostmanWooCommerce.php b/Postman/Postman-Mail/PostmanWooCommerce.php
index 1768881..e53f373 100644
--- a/Postman/Postman-Mail/PostmanWooCommerce.php
+++ b/Postman/Postman-Mail/PostmanWooCommerce.php
@@ -29,32 +29,12 @@ if ( ! class_exists( 'PostmanWoocommerce' ) ) {
public function overide_email_settings( $settings ) {
- return array(
+ $key = $this->find_woocommerce_email_from_address( $settings );
- array( 'title' => __( 'Email notifications', 'post-smtp' ), 'desc' => __( 'Email notifications sent from WooCommerce are listed below. Click on an email to configure it.', 'post-smtp' ), 'type' => 'title', 'id' => 'email_notification_settings' ),
-
- array( 'type' => 'email_notification' ),
-
- array( 'type' => 'sectionend', 'id' => 'email_notification_settings' ),
-
- array( 'type' => 'sectionend', 'id' => 'email_recipient_options' ),
-
- array( 'title' => __( 'Email sender options', 'post-smtp' ), 'type' => 'title', 'desc' => '', 'id' => 'email_options' ),
-
- array(
- 'title' => __( '"From" name', 'post-smtp' ),
- 'desc' => __( 'How the sender name appears in outgoing WooCommerce emails.', 'post-smtp' ),
- 'id' => 'woocommerce_email_from_name',
- 'type' => 'text',
- 'css' => 'min-width:300px;',
- 'default' => esc_attr( get_bloginfo( 'name', 'display' ) ),
- 'autoload' => false,
- 'desc_tip' => true,
- ),
-
- array(
+ if ( $key ) {
+ $settings[$key] = array(
'title' => __( '"From" address', 'post-smtp' ),
- 'desc' => __( 'This is overided by the account configured on Post SMTP plugin configuration.', 'post-smtp' ),
+ 'desc' => __( 'This is override by the account configured on Post SMTP plugin configuration.', 'post-smtp' ),
'id' => 'woocommerce_email_from_address',
'type' => 'email',
'custom_attributes' => array(
@@ -65,88 +45,20 @@ if ( ! class_exists( 'PostmanWoocommerce' ) ) {
'default' => $this->options->getMessageSenderEmail(),
'autoload' => false,
'desc_tip' => true,
- ),
-
- array( 'type' => 'sectionend', 'id' => 'email_options' ),
+ );
+ }
- array( 'title' => __( 'Email template', 'post-smtp' ), 'type' => 'title', 'desc' => sprintf( __( 'This section lets you customize the WooCommerce emails. <a href="%s" target="_blank">Click here to preview your email template</a>.', 'post-smtp' ), wp_nonce_url( admin_url( '?preview_woocommerce_mail=true' ), 'preview-mail' ) ), 'id' => 'email_template_options' ),
-
- array(
- 'title' => __( 'Header image', 'post-smtp' ),
- 'desc' => __( 'URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'post-smtp' ),
- 'id' => 'woocommerce_email_header_image',
- 'type' => 'text',
- 'css' => 'min-width:300px;',
- 'placeholder' => __( 'N/A', 'post-smtp' ),
- 'default' => '',
- 'autoload' => false,
- 'desc_tip' => true,
- ),
-
- array(
- 'title' => __( 'Footer text', 'post-smtp' ),
- 'desc' => __( 'The text to appear in the footer of WooCommerce emails.', 'post-smtp' ),
- 'id' => 'woocommerce_email_footer_text',
- 'css' => 'width:300px; height: 75px;',
- 'placeholder' => __( 'N/A', 'post-smtp' ),
- 'type' => 'textarea',
- /* translators: %s: site name */
- 'default' => get_bloginfo( 'name', 'display' ),
- 'autoload' => false,
- 'desc_tip' => true,
- ),
-
- array(
- 'title' => __( 'Base color', 'post-smtp' ),
- /* translators: %s: default color */
- 'desc' => sprintf( __( 'The base color for WooCommerce email templates. Default %s.', 'post-smtp' ), '<code>#96588a</code>' ),
- 'id' => 'woocommerce_email_base_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#96588a',
- 'autoload' => false,
- 'desc_tip' => true,
- ),
-
- array(
- 'title' => __( 'Background color', 'post-smtp' ),
- /* translators: %s: default color */
- 'desc' => sprintf( __( 'The background color for WooCommerce email templates. Default %s.', 'post-smtp' ), '<code>#f7f7f7</code>' ),
- 'id' => 'woocommerce_email_background_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#f7f7f7',
- 'autoload' => false,
- 'desc_tip' => true,
- ),
-
- array(
- 'title' => __( 'Body background color', 'post-smtp' ),
- /* translators: %s: default color */
- 'desc' => sprintf( __( 'The main body background color. Default %s.', 'post-smtp' ), '<code>#ffffff</code>' ),
- 'id' => 'woocommerce_email_body_background_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#ffffff',
- 'autoload' => false,
- 'desc_tip' => true,
- ),
-
- array(
- 'title' => __( 'Body text color', 'post-smtp' ),
- /* translators: %s: default color */
- 'desc' => sprintf( __( 'The main body text color. Default %s.', 'post-smtp' ), '<code>#3c3c3c</code>' ),
- 'id' => 'woocommerce_email_text_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#3c3c3c',
- 'autoload' => false,
- 'desc_tip' => true,
- ),
+ return $settings;
+ }
- array( 'type' => 'sectionend', 'id' => 'email_template_options' ),
+ private function find_woocommerce_email_from_address($settings) {
+ foreach ( $settings as $key => $data ) {
+ if ( isset( $data['id'] ) && $data['id'] == 'woocommerce_email_from_address' ) {
+ return $key;
+ }
+ }
- );
+ return false;
}
}
} \ No newline at end of file
diff --git a/Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/OptionsResolver.php b/Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/OptionsResolver.php
index f5b84f0..18b4488 100644
--- a/Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/OptionsResolver.php
+++ b/Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/OptionsResolver.php
@@ -103,7 +103,7 @@ class OptionsResolver implements Options
*
* The closure will be evaluated when {@link resolve()} is called. The
* closure has access to the resolved values of other options through the
- * passed {@link Options} instance:
+ * passed {@link Admin} instance:
*
* function (Options $options) {
* if (isset($options['port'])) {
@@ -120,7 +120,7 @@ class OptionsResolver implements Options
* // 'Default Name' === $previousValue
* });
*
- * This is mostly useful if the configuration of the {@link Options} object
+ * This is mostly useful if the configuration of the {@link Admin} object
* is spread across different locations of your code, such as base and
* sub-classes.
*
@@ -361,7 +361,7 @@ class OptionsResolver implements Options
*
* The closure is invoked when {@link resolve()} is called. The closure
* has access to the resolved values of other options through the passed
- * {@link Options} instance.
+ * {@link Admin} instance.
*
* The second parameter passed to the closure is the value of
* the option.