summaryrefslogtreecommitdiff
path: root/Postman/PostmanOptions.php
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-02-18 06:22:53 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-02-18 06:22:53 +0000
commit51f30e54a8410672eea49817d68dfe2d38b16a21 (patch)
tree56804e8be4808584a5d22e4afdf72dc8c900105e /Postman/PostmanOptions.php
parent1d2f9717ac60dd25d97894391d6e5f14d0c9c13d (diff)
downloadPost-SMTP-51f30e54a8410672eea49817d68dfe2d38b16a21.zip
= 1.9.8 - 2019-02-18
* New: a new from field to the fallback - Can't trust the username as "from" value (email address).
Diffstat (limited to 'Postman/PostmanOptions.php')
-rw-r--r--Postman/PostmanOptions.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php
index 8825681..b6eaaf4 100644
--- a/Postman/PostmanOptions.php
+++ b/Postman/PostmanOptions.php
@@ -118,6 +118,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
const FALLBACK_SMTP_HOSTNAME = 'fallback_smtp_hostname';
const FALLBACK_SMTP_PORT = 'fallback_smtp_port';
const FALLBACK_SMTP_SECURITY = 'fallback_smtp_security';
+ const FALLBACK_FROM_EMAIL = 'fallback_from_email';
const FALLBACK_SMTP_USE_AUTH = 'fallback_smtp_use_auth';
const FALLBACK_SMTP_USERNAME = 'fallback_smtp_username';
const FALLBACK_SMTP_PASSWORD = 'fallback_smtp_password';
@@ -286,7 +287,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
public function getEnvelopeSender() {
if ( $this->is_fallback ) {
- return $this->getFallbackUsername();
+ return $this->getFallbackFromEmail();
}
if ( isset( $this->options [ PostmanOptions::ENVELOPE_SENDER ] ) ) {
@@ -296,12 +297,18 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
public function getMessageSenderEmail() {
if ( $this->is_fallback ) {
- return $this->getFallbackUsername();
+ return $this->getFallbackFromEmail();
}
if ( isset( $this->options [ PostmanOptions::MESSAGE_SENDER_EMAIL ] ) ) {
return $this->options [ PostmanOptions::MESSAGE_SENDER_EMAIL ]; }
}
+
+ public function getFallbackFromEmail() {
+ if ( isset( $this->options [ PostmanOptions::FALLBACK_FROM_EMAIL ] ) ) {
+ return $this->options [ PostmanOptions::FALLBACK_FROM_EMAIL ]; }
+ }
+
public function getMessageSenderName() {
if ( isset( $this->options [ PostmanOptions::MESSAGE_SENDER_NAME ] ) ) {
return $this->options [ PostmanOptions::MESSAGE_SENDER_NAME ]; }
@@ -534,10 +541,6 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
return $this->isPluginSenderEmailEnforced();
}
public function isPluginSenderEmailEnforced() {
-
- if ( $this->is_fallback ) {
- return true;
- }
if ( $this->isNew() ) {
return self::DEFAULT_PLUGIN_MESSAGE_SENDER_EMAIL_ENFORCED; }