Skip to content

Library is not promisify-able #206

@antony

Description

@antony

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions