Hook function for email_registration drupal module

Some of the site needs email as sername for their Drupal site. Email Registration module helps to get rid of that problem.
but  it saves username from the email address whatever that is before @.

example : takim.islam@googol.se  save username as : takim.islam

Many people might think , they can update their username from hook_user case ‘Insert’ , but it will not work.
They actually dont need to do anything such that. Because there is already a hook function hook_email_registration_name($edit, $account)
which people can implement from their own module like :

mymodule_email_registration_name($edit, $account)

$string = ‘Takim Islam’; // or replace with any value from $account / $edit

return $string;


Thats it, your problem is solved!


  1. Leave a comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: