How can I get the email address of a user who has just registered? I need to add a hash key to users on register, generated from their email address and the current time, I added the field 'field_subscription_key' to user's fields and I hooked into


  custom_newsletter_mail_user_insert(&amp;$edit, $account, $category)


in module's .module file, I have no idea how can I get the email address and time the user was created from these above parameters.

Also, I don't know how to get the user entity, so I would insert the hash key.
The docs on the core entities are really good. Here are the docs on the User class.

You should be able to get the email with:

$email = $account-&gt;getEmail();


And the created time with:

$created = $account-&gt;getCreatedTime();