-
Notifications
You must be signed in to change notification settings - Fork 779
Library is not promisify-able #206
Copy link
Copy link
Closed
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: community enhancementfeature request not on Twilio's roadmapfeature request not on Twilio's roadmap
Description
To keep my application's strhatucture and approach consistent, I'm using Bluebird's promisify function to turn callbacks into promises.
Unfortunately, and it seems to be due to the use of 'this' inside sendgrid.js, promisifying the 'send' method on SendGrid causes 'this' to become undefined, and hence 'api_user' cannot be fetched, and email cannot be sent.
This is a shame as it forces me back to the callback approach.
May I suggest that the internals of the library bind the correct context when using this, or _this is used (as it does appear to be defined within sendgrid.js).
If you take pull requests, I'd be happy to make these fixes myself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: community enhancementfeature request not on Twilio's roadmapfeature request not on Twilio's roadmap