Forked from danielbitzer/custom-email-sender.php
Created
August 10, 2020 13:24
Star
You must be signed in to star a gist
AutomateWoo - Customize your email sender name #woo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// change the from name | |
add_filter( 'automatewoo/mailer/from_name', function( $from_name ) { | |
return 'My Custom From Name'; | |
}); | |
// change the from address | |
add_filter( 'automatewoo/mailer/from_address', function( $from_email ) { | |
return 'email@example.org'; | |
}); | |
// change the from based on the template | |
add_filter( 'automatewoo/mailer/from_address', function( $from_email, $template_id ) { | |
if ( $template_id == 'plain' ) { | |
return 'email@example.org'; | |
} | |
else { | |
return 'email@example.org'; | |
} | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment