Support use with multiple accounts #275
Labels
status: help wanted
requesting help from the community
type: community enhancement
feature request not on Twilio's roadmap
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.The text was updated successfully, but these errors were encountered: