Open malimccalla opened 4 years ago
I can see this was marked as non-library issue. Where is the correct place to open this issue?
Hello @malimccalla,
We will route this request to the proper location internally on your behalf and update you here on any progress. Thank you!
With best regards,
Elmer
Internal tracking#: CL-2681
Is anyone working on this?
I want this feature as well. Any plans on implementing it soon?
In case anyone else runs across this, a solution could be to implement a server which mocks the appropriate sendgrid endpoints. The example setup for the mock endpoint:
sgClient.setApiKey(SOME_KEY);
sgClient.setDefaultRequest('baseUrl', 'MOCK_SERVER_ENDPOINT');
sgMail.setClient(sgClient);
The point being that the library will run all its validation logic (as it would in sandbox mode), and one can simply return dummy data/results from the mock server all while ignoring the api key (since the mock server doesnt have to validate the key).
But I am just doing this for unit tests (and rather simple use cases) and I therefore am not sure how it would scale to bigger dev/stage environments with more complex setups in which more complex and accurate server responses are required.
I have the following file that handles my sendgrid set up.
After setting my api key I need to be able to do something like this to enable sandbox mode on all requests
The absolute best solution would be not having to add a line of code like that at all but be able to generate an api key specifically for sandbox mode (similar to how Stripe has test keys). I really don't want to use my live production key in staging and development environments. Thanks!