From 31fa4f9c45f30aef89585dfd37c100e762c6cc4c Mon Sep 17 00:00:00 2001 From: Lee Hanbury Date: Tue, 9 Feb 2021 17:48:07 +0000 Subject: [PATCH] Allow overwriting the from name and email Fixes #37 (cherry picked from commit 4f18050b686c7bb21f89107fef665e8a1f54ec53) --- includes/class-mailtpl-mailer.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/includes/class-mailtpl-mailer.php b/includes/class-mailtpl-mailer.php index 3eec84c..fd2d522 100755 --- a/includes/class-mailtpl-mailer.php +++ b/includes/class-mailtpl-mailer.php @@ -161,10 +161,11 @@ private function replace_placeholders( $email, $user_email = '' ) { * @since 1.0.0 * @return string */ - public function set_from_email( $email ){ - if( empty( $this->opts['from_email'] ) ) - return $email; - return $this->opts['from_email']; + public function set_from_email( $email ) { + if ( empty( $email ) ) { + return $this->opts['from_email']; + } + return $email; } /** @@ -172,10 +173,11 @@ public function set_from_email( $email ){ * @since 1.0.0 * @return string */ - public function set_from_name( $name ){ - if( empty( $this->opts['from_name'] ) ) - return $name; - return $this->opts['from_name']; + public function set_from_name( $name ) { + if ( empty( $name ) ) { + return $this->opts['from_name']; + } + return $name; } /**