hubot-archive / hubot-pager-me

PagerDuty integration for Hubot
https://www.npmjs.com/package/hubot-pager-me
MIT License
73 stars 93 forks source link

Problem retrieving user email #102

Closed DonEmil closed 7 years ago

DonEmil commented 7 years ago

I have used this script before and:

email = msg.message.user.pagerdutyEmail || msg.message.user.email_address

used to work and picked up Slack users emails from msg.message.user.email_address

I recently changed bot and it no longer works, it seems as if msg.message.user.email_address returns "undefined"

DonEmil commented 7 years ago

changed msg.message.user.email_address to msg.message.user.profile.email which fixed it

stephenyeargin commented 7 years ago

Hmm. The slack adapter (or Hubot core) should be disambiguating this as much as possible so that there is One True Way™ to get the email address for a user.

DonEmil commented 7 years ago

I think it depends on what version of slack adapter you use, the newer one (^4.0.0) requires msg.message.user.profile.email