Error when trying to make a post request with HTTPoison

I’m trying to make a post request to a Slack webhook. I’ve got a pretty straightforward post request here:

defmodule MyApp.Slack do
  def send(message) do
    HTTPoison.post(
      System.get_env("SLACK_WEBHOOK_URL_QUESTIONS"),
      '{"text": "#{message}"}',
      [{"Content-Type", "application/json"}]
    )
  end
end

This works locally but when I try to make this request on staging I’m getting this error:

{:error, %HTTPoison.Error{reason: :nxdomain, id: nil}}

Not sure what to make of that error and I haven’t found much documentation on this either.

Means a domain can’t be resolved. Is the environment variable set on your staging environment?