summaryrefslogtreecommitdiff
path: root/Postman/PostmanOptions.php
diff options
context:
space:
mode:
authoryehuda <yehuda@myinbox.in>2019-03-04 16:47:56 +0200
committeryehuda <yehuda@myinbox.in>2019-03-04 16:47:56 +0200
commit4676163d78d8bbf9758b39648612d021e000b115 (patch)
tree4456d44f3e63bf8a78f507eb9abb4ba123a75827 /Postman/PostmanOptions.php
parent1c687646231fa31cea77eb3aa994a4a037ce670a (diff)
downloadPost-SMTP-4676163d78d8bbf9758b39648612d021e000b115.zip
* 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; }