Unable to login to SendGrid Using Heroku Rails AddOn Credentials

Viewed 490

I am trying to integrate SendGrid with Heroku, and receive the following error when I try to log in to SendGrid using the Heroku addon credentials:

You are not authorized to access SendGrid, please contact Support.

I have reached out to SendGrid Support to no avail...

I already had my app successfully pushed and hosted on heroku. I have my credit card details in heroku, so not an issue there...

Here were my steps:

(I followed the docs at https://devcenter.heroku.com/articles/sendgrid#provisioning-the-add-on)
$ heroku addons:create sendgrid:starter >>(success)
$ heroku config:get SENDGRID_USERNAME >>(app1905xxxxx@heroku.com)
$ heroku config:get SENDGRID_PASSWORD >>(abcdedfghij)

Then I attempted to login to sendgrid with these credentials and got the error message:

You are not authorized to access SendGrid, please contact Support.

I can see in my heroku dashboard that the Addon is present. [Heroku dashboard img][2] However, when I click the Addon in the heroku dashboard it shows the following: [SendGrid Addon img][3] JSON:

SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

HEADERS:
Response Headers:

Cache-Control   no-cache, must-revalidate, no-cache, must-revalidate
Connection  keep-alive
Content-Encoding    gzip
Content-Type    application/json
Date    Wed, 18 Nov 2020 23:10:16 GMT
Expires 0
Referrer-Policy origin-when-cross-origin
Server  nginx
Transfer-Encoding   chunked

Request headers

Vary    Accept-Encoding
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding gzip, deflate, br
Accept-Language en-US,en;q=0.5
Connection  keep-alive
DNT 1
Host    sendgrid.com
Sec-GPC 1
Upgrade-Insecure-Requests   1
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0

Any help is greatly appreciated, thank you! [1]: https://devcenter.heroku.com/articles/sendgrid#provisioning-the-add-on [2]: https://i.stack.imgur.com/SDPT0.png [3]: https://i.stack.imgur.com/aGfMJ.png

2 Answers

It's not about you, it's about Sendgrid

Since Twilio acquired Sendgrid, many developers are experiencing the same issue:


In my case, I am using SendGrid with Heroku

I managed to make it work by verifying a phone number at this link:

https://tools.heroku.support/addons-verification/verify


If it does not work for you, I would recommend to explore alternatives. Here is a good explanation of how to set up different SendGrid alternatives.

https://hixonrails.com/ruby-on-rails-tutorials/ruby-on-rails-action-mailer-configuration/

The easiest one (if you are using heroku) would be Mailgun

It sounds like you tried this but just putting this here for anybody who might land on this question after failing to log in via the Heroku dashboard (I always had problems with that working inconsistently, but now that they require 2FA it will never work again).

  1. Find the credentials, either using command line (ex: $ heroku config:get SENDGRID_USERNAME -a <your-app>) or viewing the config variables at https://dashboard.heroku.com/apps/your-app/settings
  2. Use them to log in directly from Sendgrid at https://app.sendgrid.com/login
Related