summaryrefslogtreecommitdiff
path: root/Postman/PostmanWpMail.php
diff options
context:
space:
mode:
authoryehuda <yehuda@myinbox.in>2019-03-04 16:44:26 +0200
committeryehuda <yehuda@myinbox.in>2019-03-04 16:44:26 +0200
commit1c687646231fa31cea77eb3aa994a4a037ce670a (patch)
tree45e0858a4869f6a082fec91d34666627448f8d54 /Postman/PostmanWpMail.php
parente33f6bd6bce974ec0d9836e1589ea1facf159841 (diff)
downloadPost-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/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
*