Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Includes user's email in profile if returned from facebook API
Browse files Browse the repository at this point in the history
If the Facebook profile API returns the user's email address, which it does for Workplace integrations, the Botkit profile should include it.
  • Loading branch information
iniq committed Dec 22, 2017
1 parent 12fd015 commit 3db3993
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function Facebookbot(configuration) {
first_name: identity.first_name,
last_name: identity.last_name,
full_name: identity.first_name + ' ' + identity.last_name,
email: null, // no source for this info
email: identity.email || null,
gender: identity.gender,
timezone_offset: identity.timezone,
};
Expand Down Expand Up @@ -765,7 +765,7 @@ function Facebookbot(configuration) {

var user_profile = function(uid, fields, cb) {
if (!fields) {
fields = 'first_name,last_name,timezone,gender,locale';
fields = 'first_name,last_name,timezone,gender,locale,email';
}
return new Promise(function(resolve, reject) {
var uri = 'https://' + api_host + '/v2.6/' + uid + '?fields=' + fields + '&access_token=' + configuration.access_token;
Expand Down

0 comments on commit 3db3993

Please sign in to comment.