I used Content Profile for my user profile in the site I'm currently developing. I also have the Profile be filled at user registration, spefically "First Name" and "Last Name". Now instead of username, I want to use the First Name to address the new user on the notification email that shall be sent to his/her. I mean like this: http://screencast.com/t/LQGxBrDxJ53

I tried the hook_mail_alter where I altered the email's subject and body with the First Name in the right place. I tried extracting the First Name by using the content_profile_load() function, then the correct variable, e.g. $content_profile->field_first_name[0]['value'] but it seems like, the variable still NULL at this moment the email is sent. Most probably, the email was sent before the Profile node (by Content Profile) is being created.

The next thing I did was hook_user on op = insert. I want to insert a new field/column on the user object or, if that is impossible, just replace $account->name with the value on First Name that the user submitted. HOWEVER, when I printed out the values of $edit, I cannot see the profile fields in the array of values. That makes my supposed workaround impossible to do again.

I'm out of thoughts how to deal with it. I love Content Profile's extensibility, but it seems like this issue hasn't been opened before, but I could be wrong. Can anyone help me out?

Thanks in advance.


jayjaydluffy’s picture

Title: Content profile fields values can be used on confirmation email at user registration » Content profile fields values can't be used on confirmation email at user registration
Gogowitsch’s picture

I'd love to use this feature, too. Is there any module that might supply this functionality to Content Profile?

pglynn’s picture

I'm in the same boat here. If someone has a workaround for this or any suggestions it would be great.

jludwig’s picture

I posted a tutorial here: http://jludwig.net/drupal/rules-flexible-user-notification-emails on how to do this. There's another way to do it using hook_mail_alter(), but I don't think there are enough use cases to really add it to Content Profile.