How can I send a facebook user an email when they click on the FB like button?

依然范特西╮ 提交于 2019-12-04 07:02:26

问题


After a user clicks the Facebook like button on my page, I want to automatically send an email to them. Is this possible?


回答1:


You cannot enforce user to connect with your application and grant email permission by clicking Like Button.

You can however subscribe to edge.create event (using JS-SDK) and call FB.login to provide your user with ability to connect with your app (requesting email permission) so you'll be able to send an email to him. This is an optional and as I said can't be enforcement. As long as user able to see Like Button nothing can prevent him to click it.

Other option is displaying Like Button only to users who already authorized your application, so you can grab all the required info before he even able to like, later display Like Button, listen to event and send an email.

Update:
You'll probably want to read documentation on JS-SDK, especially on FB.Event.subscribe and FB.login.

Update2:
As it seems (according to other question you created) that you're trying to achieve this in Facebook Page tab. This making the task unsolvable since user will always see and be able to like page before you can do something. You can only request desired info from user in Page tab application and it's totally up to user to accept it or not...



来源:https://stackoverflow.com/questions/9272802/how-can-i-send-a-facebook-user-an-email-when-they-click-on-the-fb-like-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!