summaryrefslogtreecommitdiff
path: root/Postman/PostmanOptions.php
diff options
context:
space:
mode:
authorYehuda Hassine <yehudah@users.noreply.github.com>2018-08-03 16:52:56 +0300
committerGitHub <noreply@github.com>2018-08-03 16:52:56 +0300
commit5ba3d1036e32da18cc8f24a3c72c8cd5a418d7f3 (patch)
tree7d763d8aac80cbbdcaf467ee59591fb4a2e88921 /Postman/PostmanOptions.php
parentf19076d5f2c4874718a6d70e4f013ab9dbd0aa79 (diff)
parent16243e7d078bde68fa6919b276d5d34d67b97d01 (diff)
downloadPost-SMTP-5ba3d1036e32da18cc8f24a3c72c8cd5a418d7f3.zip
Merge pull request #13 from NielsdeBlaauw/master
Allow for API_KEY and RUN_MODE in wp-config
Diffstat (limited to 'Postman/PostmanOptions.php')
-rw-r--r--Postman/PostmanOptions.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php
index f0d675e..3357682 100644
--- a/Postman/PostmanOptions.php
+++ b/Postman/PostmanOptions.php
@@ -178,6 +178,10 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
} else { return self::DEFAULT_MAIL_LOG_ENABLED; }
}
public function getRunMode() {
+ if ( defined( 'POST_SMTP_RUN_MODE' ) ) {
+ return POST_SMTP_RUN_MODE;
+ }
+
if ( isset( $this->options [ self::RUN_MODE ] ) ) {
return $this->options [ self::RUN_MODE ];
} else { return self::DEFAULT_RUN_MODE; }
@@ -285,24 +289,35 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
}
}
public function getPassword() {
-
- if ( defined( 'POST_SMTP_AUTH_PASSWORD' ) ) {
- return POST_SMTP_AUTH_PASSWORD;
- }
+ if ( defined( 'POST_SMTP_AUTH_PASSWORD' ) ) {
+ return POST_SMTP_AUTH_PASSWORD;
+ }
if ( isset( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] ) ) {
return base64_decode( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] );
}
}
public function getMandrillApiKey() {
+ if ( defined( 'POST_SMTP_API_KEY' ) ) {
+ return POST_SMTP_API_KEY;
+ }
+
if ( isset( $this->options [ PostmanOptions::MANDRILL_API_KEY ] ) ) {
return base64_decode( $this->options [ PostmanOptions::MANDRILL_API_KEY ] ); }
}
public function getSendGridApiKey() {
+ if ( defined( 'POST_SMTP_API_KEY' ) ) {
+ return POST_SMTP_API_KEY;
+ }
+
if ( isset( $this->options [ PostmanOptions::SENDGRID_API_KEY ] ) ) {
return base64_decode( $this->options [ PostmanOptions::SENDGRID_API_KEY ] ); }
}
public function getMailgunApiKey() {
+ if ( defined( 'POST_SMTP_API_KEY' ) ) {
+ return POST_SMTP_API_KEY;
+ }
+
if ( isset( $this->options [ PostmanOptions::MAILGUN_API_KEY ] ) ) {
return base64_decode( $this->options [ PostmanOptions::MAILGUN_API_KEY ] ); }
}