summaryrefslogtreecommitdiff
path: root/Postman/PostmanWpMail.php
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/PostmanWpMail.php
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/PostmanWpMail.php')
-rw-r--r--Postman/PostmanWpMail.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/Postman/PostmanWpMail.php b/Postman/PostmanWpMail.php
index f5fcf7f..173b35e 100644
--- a/Postman/PostmanWpMail.php
+++ b/Postman/PostmanWpMail.php
@@ -235,6 +235,13 @@ if ( ! class_exists( 'PostmanWpMail' ) ) {
PostmanEmailLogService::getInstance()->writeFailureLog( $log, $message, $engine->getTranscript(), $transport, $e->getMessage() );
}
+ // Fallback
+ if ( $this->fallback( $log, $message, $options ) ) {
+
+ return true;
+
+ }
+
$mail_error_data = array(
'to' => $message->getToRecipients(),
'subject' => $message->getSubject(),
@@ -248,9 +255,29 @@ if ( ! class_exists( 'PostmanWpMail' ) ) {
// return failure
return false;
+
}
}
+ private function fallback( $log, $postMessage,$options ) {
+
+ if ( ! $options->is_fallback && $options->getFallbackIsEnabled() && $options->getFallbackIsEnabled() == 'yes' ) {
+
+ $options->is_fallback = true;
+
+ $status = $this->sendMessage( $postMessage, $log );
+
+ $options->is_fallback = false;
+
+ return $status;
+
+ } else {
+ $options->is_fallback = false;
+ }
+
+ return false;
+ }
+
/**
* Clean up after sending the mail
*