alexgaribay / sendgrid_elixir

Create and send composable emails with Elixir and SendGrid.
MIT License
86 stars 44 forks source link

Send email with sandbox: true require api_key #22

Closed mbenatti closed 6 years ago

mbenatti commented 6 years ago

Hello, In my point of view when the mode is in "sandbox", this shouldn't require the "api_key" config. This error occurs when I send an email with sandbox: true option and without api_key(dev or test mode):

     ** (RuntimeError) No API key is configured for SendGrid. Update your config before making an API call.

         config :sendgrid,
           api_key: "sengrid_api_key"
alexgaribay commented 6 years ago

Sandbox isn't defined by me, it's defined by the SendGrid API. It still requires a valid API key to work.

https://sendgrid.com/docs/API_Reference/api_v3.html

This is directly from their docs about enabling the sandbox:

This allows you to send a test email to ensure that your request body is valid and formatted correctly.

mbenatti commented 6 years ago

There's any working around or plans to implement a logic avoid the required api_key for :dev or :test when it need to send an email ? Or the objective of this API is only to follow sendgrid docs?