I'm currently using 'fast registration mode' and when users are created on the system, the email address that goes in the users table looks like this:

apps+275294395206.787348261.0e13175f285cbf235f5326a25b8c427d@pro

It would be great to collect a user's real email address - is this possible? Or is there an easy way to encourage the user into granting the necessary permission?

Many thanks,
Chris.

Comments

abraham’s picture

It would be fairly simple to do a hook_form_alter to add a required email field to the fbconnect registration form. If you want to the email to be verified it would be a little more work. Facebook will also provide email addresses specific for the user/app combo that you can pull from their API.

chrism2671’s picture

Category: support » feature

Well at present, if the facebook login cookie is set, a user literally has to do nothing except click on the button to login to drupal. They don't even need to type in their email. What I'd like to do is collect their email address from facebook- how would I go about doing that, and shoudn't fbconnect do it by default?

problue solutions’s picture

This is what I REALLY REALLY need, the module is working great but I need the email address of the Facebook user transfeered to the Drupal account.

Is this likely to be included as a feature or is very difficult to implement?

rf-pldev’s picture

Facebook doesn't provide the real email address but an alias, so you would need to provide an additional field to collect the users real email yourself. In theory, it should be fine to use the alias, and if the user changes their real email address via Facebook, the alias still works, so you always have the same email address as the FB account.

problue solutions’s picture

"n theory, it should be fine to use the alias"

Do you mean that this address will actually work if I contact a Facebook user though my site? If thats the case then I don't need the real email address, I just need to be able to contact users.

rf-pldev’s picture

It looks like the email address alias ("proxied email") is being truncated, so either the mail field would need to be lengthened or a new column for the proxied email would need to be created.

Once you have the full proxied email address, you can use that to send email as outlined below:
http://wiki.developers.facebook.com/index.php/Proxied_Email

karimbolivia’s picture

Same problem here. I would like to send emails to thse users but the alias seems truncated...

chrism2671’s picture

Where is it getting truncated? According to the DB structure the users->mail field is good for 64 chars.

mediabounds’s picture

That's where the e-mail address is getting truncated - after 64 characters. Maybe try extending the length of the field in the database?

abraham’s picture

You can send emails through facebook knowing only the users fbuid.

http://wiki.developers.facebook.com/index.php/Notifications.sendEmail

rf-pldev’s picture

If the session is open, you can use the FB UID, otherwise the proxy email is 82+ characters unless you trim off the "@proxymail.facebook.com", but there is no guarantee that they might not change the format in the future, so the safest approach would be to increase the email field to something like 200 chars. If you already have truncated emails, you should be able to use them if you have data up to the "@" sign -- replace the truncated bit after "@" with "proxymail.facebook.com".

yrre7’s picture

subscribe

vectoroc’s picture

Try http://drupal.org/node/635568#comment-2307480
Backup database and module before just for case

hexen’s picture

Sooo... how to fix email collecting? i have beta9 and as i can see, it's with these patches, but still i have email not working, and changing/displaying avatar to, but i already fixed it up... dimension problems r still same...

can anyone tell me where i can get some fix for email?

vectoroc’s picture

did you run update.php ?

vectoroc’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.