Skip to content

Instantly share code, notes, and snippets.

@meetawahab
Last active February 24, 2020 06:08
Show Gist options
  • Save meetawahab/b5f31c28cfd2672eb8da9a3362a52bb0 to your computer and use it in GitHub Desktop.
Save meetawahab/b5f31c28cfd2672eb8da9a3362a52bb0 to your computer and use it in GitHub Desktop.
Changing Default Sender Name and Email.
<?php
// Function to change email address.
function ab610_sender_email( $original_email_address ) {
return 'your_email@example.com';
}
// Function to change sender name.
function ab610_sender_name( $original_email_from ) {
return 'Site or Your Name';
}
// Hooking up our functions to WordPress filters.
add_filter( 'wp_mail_from', 'ab610_sender_email' );
add_filter( 'wp_mail_from_name', 'ab610_sender_name' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment