Created
May 12, 2022 15:40
-
-
Save ivanmercedes/5c812603f40ccdf1965714919d85eddd to your computer and use it in GitHub Desktop.
Change Sender Name in Outgoing WordPress Email
This file contains hidden or 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 | |
| // Function to change sender email | |
| function wpb_sender_email( $original_email_address ) { | |
| return 'no-replay@example.com'; | |
| } | |
| // Function to change sender name | |
| function wpb_sender_name( $original_email_from ) { | |
| return 'Example Name'; | |
| } | |
| // Hooking up our functions to WP filters | |
| add_filter( 'wp_mail_from', 'wpb_sender_email' ); | |
| add_filter( 'wp_mail_from_name', 'wpb_sender_name' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment