WordPress.org

Ready to get started?Download WordPress

Forums

Problem with e-mail sender name (5 posts)

  1. sachin87
    Member
    Posted 5 years ago #

    Hello everybody. I've installed WordPress on my site and it's working fine but I am having a problem with my mailing system. Whenever a new person registers on my site, he/she gets a mail with the sender name "WordPress", I want to change it to "Admin" but I don't know how to do it.So please help me.

    Thanks in advance.

  2. Wildrot
    Member
    Posted 5 years ago #

    Hey sachin87,

    if you're on WP2.7, check /wp-includes/pluggable.php lines 354 and 976

  3. gravitron
    Member
    Posted 5 years ago #

    To change the send name (rather than address) change line 343 from:
    $from_name = 'WordPress';
    to:
    $from_name = get_option('blogname');

  4. jpadie
    Member
    Posted 4 years ago #

    why not just plug it?

    <?php
    /*
    Plugin Name: Change Email From Address/Name
    Plugin URI: http://rathercurious.net
    Description: changes the email from address
    Version: 0.1.0
    Author: Justin Adie
    Author URI: http://rathercurious.net
    */
    
    class emailFrom{
    	public function __construct(){
    		add_filter('wp_mail_from', array(&$this, 'doEmailFilter'),10, 1);
    		add_filter('wp_mail_from_name', array(&$this, 'doEmailNameFilter'), 10, 1);
    	}
    
    	public function doEmailFilter($data){
    		return 'address@domain.com';
    	}
    	public function doEmailNameFilter($data){
    		return 'My Name';
    	}
    }
    $_ef = new emailFrom();
    
    ?>

    the annoyance that i have is that ampersands seem to come through as their literal html equivalent and the various email clients that i have (apple MAIL and Entourage) do not seem to translate back into html characters (at least in the subject). this can also be plugged if you want. add this filter to the constructor

    add_filter('wp_mail', array(&$this, 'decode'), 10,1);

    and add this method to the class

    public function decode($array){
    		$array['subject'] = html_entity_decode($array['subject']);
    		return $array;
    	}
  5. bestcssdesigns
    Member
    Posted 4 years ago #

    I have this problem too. However, if I update wordpress, won't I have to go back into the code?

Topic Closed

This topic has been closed to new replies.

About this Topic