summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail
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-Mail
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-Mail')
-rw-r--r--Postman/Postman-Mail/PostmanMyMailConnector.php44
-rw-r--r--Postman/Postman-Mail/PostmanSendGridMailEngine.php1
-rw-r--r--Postman/Postman-Mail/mailchimp-mandrill-api-php-da3adc10042e/src/Mandrill.php2
3 files changed, 24 insertions, 23 deletions
diff --git a/Postman/Postman-Mail/PostmanMyMailConnector.php b/Postman/Postman-Mail/PostmanMyMailConnector.php
index 151deed..e08aa02 100644
--- a/Postman/Postman-Mail/PostmanMyMailConnector.php
+++ b/Postman/Postman-Mail/PostmanMyMailConnector.php
@@ -1,6 +1,6 @@
<?php
-define( 'MYMAIL_POSTMAN_REQUIRED_VERSION', '2.0' );
-define( 'MYMAIL_POSTMAN_ID', 'postman' );
+define( 'MAILSTER_POSTMAN_REQUIRED_VERSION', '2.0' );
+define( 'MAILSTER_POSTMAN_ID', 'postman' );
/**
* Enables MyMail to deliver via Postman
@@ -36,36 +36,36 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
* Initialize the Connector
*/
public function init() {
- if ( ! defined( 'MYMAIL_VERSION' ) || version_compare( MYMAIL_POSTMAN_REQUIRED_VERSION, MYMAIL_VERSION, '>' ) ) {
+ if ( ! defined( 'MAILSTER_VERSION' ) || version_compare( MAILSTER_POSTMAN_REQUIRED_VERSION, MAILSTER_VERSION, '>' ) ) {
// no-op
} else {
// create an instance of the Logger
$this->logger = new PostmanLogger( get_class( $this ) );
$this->logger->debug( 'Starting' );
- add_filter( 'mymail_delivery_methods', array(
+ add_filter( 'mailster_delivery_methods', array(
&$this,
'delivery_method',
) );
- add_action( 'mymail_deliverymethod_tab_postman', array(
+ add_action( 'mailster_deliverymethod_tab_postman', array(
&$this,
'deliverytab',
) );
- if ( mymail_option( 'deliverymethod' ) == MYMAIL_POSTMAN_ID ) {
- add_action( 'mymail_initsend', array(
+ if ( mailster_option( 'deliverymethod' ) == MAILSTER_POSTMAN_ID ) {
+ add_action( 'mailster_initsend', array(
&$this,
'initsend',
) );
- add_action( 'mymail_presend', array(
+ add_action( 'mailster_presend', array(
&$this,
'presend',
) );
- add_action( 'mymail_dosend', array(
+ add_action( 'mailster_dosend', array(
&$this,
'dosend',
) );
- add_action( 'MYMAIL_POSTMAN_cron', array(
+ add_action( 'MAILSTER_POSTMAN_cron', array(
&$this,
'reset',
) );
@@ -76,7 +76,7 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
/**
* initsend function.
*
- * uses mymail_initsend hook to set initial settings
+ * uses mailster_initsend hook to set initial settings
*
* @access public
* @param mixed $mailobject
@@ -91,7 +91,7 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
/**
* presend function.
*
- * uses the mymail_presend hook to apply setttings before each mail
+ * uses the mailster_presend hook to apply setttings before each mail
*
* @access public
* @param mixed $mailobject
@@ -110,7 +110,7 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
/**
* dosend function.
*
- * uses the mymail_dosend hook and triggers the send
+ * uses the mailster_dosend hook and triggers the send
*
* @access public
* @param mixed $mailobject
@@ -158,8 +158,8 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
* @return array
*/
public function reset() {
- update_option( '_transient__mymail_send_period_timeout', false );
- update_option( '_transient__mymail_send_period', 0 );
+ update_option( '_transient__mailster_send_period_timeout', false );
+ update_option( '_transient__mailster_send_period', 0 );
}
/**
@@ -172,7 +172,7 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
* @return void
*/
public function delivery_method( $delivery_methods ) {
- $delivery_methods [ MYMAIL_POSTMAN_ID ] = __( 'Postman SMTP', Postman::TEXT_DOMAIN );
+ $delivery_methods [ MAILSTER_POSTMAN_ID ] = __( 'Postman SMTP', Postman::TEXT_DOMAIN );
return $delivery_methods;
}
@@ -195,8 +195,8 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
* @return void
*/
public function activate() {
- if ( defined( 'MYMAIL_VERSION' ) && version_compare( MYMAIL_POSTMAN_REQUIRED_VERSION, MYMAIL_VERSION, '<=' ) ) {
- mymail_notice( sprintf( __( 'MyMail: Change the delivery method in the %s!', Postman::TEXT_DOMAIN ), sprintf( '<a href="options-general.php?page=newsletter-settings&mymail_remove_notice=mymail_delivery_method#delivery">%s</a>', __( 'Settings', 'postman-smtp' ) ) ), '', false, 'delivery_method' );
+ if ( defined( 'MAILSTER_VERSION' ) && version_compare( MAILSTER_POSTMAN_REQUIRED_VERSION, MAILSTER_VERSION, '<=' ) ) {
+ mailster_notice( sprintf( __( 'MyMail: Change the delivery method in the %s!', Postman::TEXT_DOMAIN ), sprintf( '<a href="edit.php?post_type=newsletter&page=mailster_settings&mailster_remove_notice=mailster_delivery_method#delivery">%s</a>', __( 'Settings', 'postman-smtp' ) ) ), '', false, 'delivery_method' );
$this->reset();
}
}
@@ -208,11 +208,11 @@ if ( ! class_exists( 'PostmanMyMailConnector' ) ) {
* @return void
*/
public function deactivate() {
- if ( defined( 'MYMAIL_VERSION' ) && function_exists( 'mymail_option' ) && version_compare( MYMAIL_POSTMAN_REQUIRED_VERSION, MYMAIL_VERSION, '<=' ) ) {
- if ( mymail_option( 'deliverymethod' ) == MYMAIL_POSTMAN_ID ) {
- mymail_update_option( 'deliverymethod', 'simple' );
+ if ( defined( 'MAILSTER_VERSION' ) && function_exists( 'mailster_option' ) && version_compare( MAILSTER_POSTMAN_REQUIRED_VERSION, MAILSTER_VERSION, '<=' ) ) {
+ if ( mailster_option( 'deliverymethod' ) == MAILSTER_POSTMAN_ID ) {
+ mailster_update_option( 'deliverymethod', 'simple' );
/* Translators where %s is the name of the page */
- mymail_notice( sprintf( __( 'MyMail: Change the delivery method in the %s!', Postman::TEXT_DOMAIN ), sprintf( '<a href="options-general.php?page=newsletter-settings&mymail_remove_notice=mymail_delivery_method#delivery">%s</a>', __( 'Settings', 'postman-smtp' ) ) ), '', false, 'delivery_method' );
+ mailster_notice( sprintf( __( 'MyMail: Change the delivery method in the %s!', Postman::TEXT_DOMAIN ), sprintf( '<a href="edit.php?post_type=newsletter&page=mailster_settings&mailster_remove_notice=mailster_delivery_method#delivery">%s</a>', __( 'Settings', 'postman-smtp' ) ) ), '', false, 'delivery_method' );
}
}
}
diff --git a/Postman/Postman-Mail/PostmanSendGridMailEngine.php b/Postman/Postman-Mail/PostmanSendGridMailEngine.php
index 06302b0..32cfb9e 100644
--- a/Postman/Postman-Mail/PostmanSendGridMailEngine.php
+++ b/Postman/Postman-Mail/PostmanSendGridMailEngine.php
@@ -210,6 +210,7 @@ if ( ! class_exists( 'PostmanSendGridMailEngine' ) ) {
$this->transcript .= PostmanModuleTransport::RAW_MESSAGE_FOLLOWS;
$this->transcript .= print_r( $mail, true );
$this->logger->debug( 'Transcript=' . $this->transcript );
+
throw $e;
}
}
diff --git a/Postman/Postman-Mail/mailchimp-mandrill-api-php-da3adc10042e/src/Mandrill.php b/Postman/Postman-Mail/mailchimp-mandrill-api-php-da3adc10042e/src/Mandrill.php
index 61ebdca..4d4e675 100644
--- a/Postman/Postman-Mail/mailchimp-mandrill-api-php-da3adc10042e/src/Mandrill.php
+++ b/Postman/Postman-Mail/mailchimp-mandrill-api-php-da3adc10042e/src/Mandrill.php
@@ -149,7 +149,7 @@ class Postman_Mandrill {
public function castError($result) {
if($result['status'] !== 'error' || !$result['name']) throw new Postman_Mandrill_Error('We received an unexpected error: ' . json_encode($result));
- $class = (isset(self::$error_map[$result['name']])) ? self::$error_map[$result['name']] : 'Mandrill_Error';
+ $class = (isset(self::$error_map[$result['name']])) ? self::$error_map[$result['name']] : 'Postman_Mandrill_Error';
return new $class($result['message'], $result['code']);
}