Skip to content

Instantly share code, notes, and snippets.

@wpmark
Created October 12, 2021 17:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wpmark/786a597d892d831f8de31f113f32c78b to your computer and use it in GitHub Desktop.
Save wpmark/786a597d892d831f8de31f113f32c78b to your computer and use it in GitHub Desktop.
Easily customise the name and email address of WordPress emails
<?php
/**
* Used to filter email from 'address'
*/
function hd_email_send_wp_mail_address( $input ) {
// return a new from email address.
return 'no-reply@highrise.digital';
}
add_filter( 'wp_mail_from', 'hd_email_send_wp_mail_address' );
/**
* Used to filter email from 'name'
*/
function hd_email_send_wp_mail_name( $input ) {
return __( 'Highrise Digital' ); // you can set this string to whatever you want.
}
add_filter( 'wp_mail_from_name', 'hd_email_send_wp_mail_name' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment