Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support use with multiple accounts #275

Closed
mrfelton opened this issue Aug 19, 2016 · 0 comments
Closed

Support use with multiple accounts #275

mrfelton opened this issue Aug 19, 2016 · 0 comments
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@mrfelton
Copy link

Issue Summary

Currently, everything is a static method on the SendGrid class. This means that it's not possible to use multiple instances of the class to connect to different SendGrid accounts (for example, since changing the API key will affect all subsequent code that uses the SendGrid class.

I'd suggest moving the API method to an instance method, and turn the existing constructor into a factory method that returns a new instance of the class with the configured API key. This way, calling sendgrid(API_KEY) will get you a new instance of the SendGrid class with the API key set for that instance alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

2 participants