Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve wp_mail to send from branded name and address #40

Closed
TimBHowe opened this issue Jan 22, 2014 · 3 comments
Closed

Improve wp_mail to send from branded name and address #40

TimBHowe opened this issue Jan 22, 2014 · 3 comments

Comments

@TimBHowe
Copy link
Contributor

So by default all emails sent using the wp_mail functions, such as new users emails, have the default sender name as "WordPress" and the default sender email address as [email protected]

I suggest we add the following to the base_functions file to allow for banded names:

// Update WordPresses wp_mail from address
add_filter( 'wp_mail_from', 'custom_wp_mail_from' );
function custom_wp_mail_from( $original_email_address ){
    //Make sure the email is from the same domain
    //as your website to avoid being marked as spam.
    return get_option('admin_email');
}

// Update WordPresses wp_mail from name
add_filter( 'wp_mail_from_name', 'custom_wp_mail_from_name' );
function custom_wp_mail_from_name( $original_email_from ){
    return get_option('blogname');
}

Referance: http://codex.wordpress.org/Function_Reference/wp_mail

We should also discuss how we can keep the admin_email for the site as [email protected] but allow a banded email, exmaple [email protected], to be used.

@rclations
Copy link
Contributor

test to ensure that this doesn't override gravity form settings

@TimBHowe
Copy link
Contributor Author

TimBHowe commented Mar 4, 2014

This function will be included in the white labeling plugin.

@TimBHowe
Copy link
Contributor Author

Moved issue to hallme/wp-whitelabel#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants