Skip to content

Commit

Permalink
Allow overwriting the from name and email
Browse files Browse the repository at this point in the history
Fixes #37

(cherry picked from commit 4f18050)
  • Loading branch information
codepuncher committed Jul 29, 2022
1 parent f56e30f commit eabd023
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions includes/class-mailtpl-mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,23 @@ 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;
}

/**
* Sets email's From name
* @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;
}

/**
Expand Down

0 comments on commit eabd023

Please sign in to comment.