Forums

How to change 'from: wordpress' for user registration emails? (3 posts)

  1. HF T
    Member
    Posted 1 year ago #

    Hi Guys,

    The title pretty much says it all.

    I've just setup a user registration system for content on my site and I don't want my emails to be from 'WordPress'.

    Is there a way to set it as my blog name?

    Thanks.

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    you could use a plugin, for instance: http://wordpress.org/extend/plugins/new-user-email-set-up/
    (i do not use any myself)

    or, you could put some code like this into functions.php of your theme:

    //notification mail email and name change
    
    add_filter('wp_mail_from','custom_email_from');
    
    function custom_email_from($mail) {
    // use the original admin email for notifications; adjust the number for different user id
    $user_info = get_userdata(1);
    $email = $user_info->user_email;
    if($email) $mail = $email;
    return $mail;
    }
    
    add_filter('wp_mail_from_name','custom_email_from_name');
    
    function custom_email_from_name($name) {
    // set a custom name for notifications
    $name = 'put your name here';
    return $name;
    }

    http://codex.wordpress.org/Plugin_API/Filter_Reference

  3. HF T
    Member
    Posted 1 year ago #

    Thanks alchymyth,

    I'll try the code to keep the resources down!

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic