Currently, if "Full user data" is selected under "Notifications sender", emails arrive from "username " The user's full name could be pulled from the Profiles module, if available, so that the header appears as "User's Name ". This would look a LOT better on our site, which pulls usernames from CAS (which means that they are a random assortment of letters and numbers)

Comments

danepowell’s picture

I have hacked together a basic working version of this, but it probably needs to be greatly improved by someone more experienced.

First, in messaging.module, I changed lines 779-780 to

    $user= user_load(array('uid' => $uid));
    profile_load_profile($user);
    $cache[$uid] = $user;

I don't know if this is the best place to implement this, and obviously before profile_load_profile is called we should make sure the profile module exists.

Then on line 844 I changed $message->sender_account->name to $message->sender_account->profile_fullname

Finally on notifications.cron.inc line 370, I change $message['sender_name'] = $sender->name; to $message['sender_name'] = $sender->profile_fullname;

danepowell’s picture

Note: don't actually use this code, I am discovering that it has some odd unintended side-effects in the messaging module. Let's just call it a proof of concept :)

danepowell’s picture

Alternatively, it might be a better idea to pull the name from the Realname module, which in turn can pull the real name from a number of sources, including the Profile module or Content Profile or any CCK field.

jose reyero’s picture

Status: Active » Closed (fixed)

It's not as simple as that, depending on the site you may be disclosing personal information so this needs some settings for it to be configurable...

Anyway, this is notifications module and there are similar issues there, please find and follow up on them.

danepowell’s picture

Status: Closed (fixed) » Closed (duplicate)