We've moved discussions to Discord

Sendgrid Net::SMTPAuthenticationError (451 Authentication failed: Could not authenticate) error in production

EDIT:
Solved. I was being dumb. 
I had things set up like this...
sendgrid:
  # https://app.sendgrid.com/settings/api_keys
  username: 'my-api-key'
  password: ''
  domain: my-domain.com


But it should have been this:
sendgrid:
  # https://app.sendgrid.com/settings/api_keys
  username: 'apikey' #this exact string
  password: '<your api key>'
  domain: my-domain.com

-------------------------
Hi All,

Working on getting my transactional emails set up and having a little bit of trouble.

In jumpstart configs I've set Sendgrid as my transactional email handler.  I've also added my key to the encrypted credential for production ala:
sendgrid:
  # https://app.sendgrid.com/settings/api_keys
  username: 'my-api-key'
  password: ''
  domain: my-domain.com

But I keep getting the following error in production (I'm with heroku and DID NOT set up Sendgrid through heroku's dashboard, but through sendgrid.com)
 
I, [2021-01-23T19:15:34.754365 #4]  INFO -- : [289612bd-42e0-4931-84d2-220260290edf] Completed 500 Internal Server Error in 42ms (ActiveRecord: 6.9ms | Allocations: 4395)
F, [2021-01-23T19:15:34.755704 #4] FATAL -- : [289612bd-42e0-4931-84d2-220260290edf]
[289612bd-42e0-4931-84d2-220260290edf] Net::SMTPAuthenticationError (451 Authentication failed: Could not authenticate
):
[289612bd-42e0-4931-84d2-220260290edf]
[289612bd-42e0-4931-84d2-220260290edf] vendor/ruby-2.7.0/lib/ruby/2.7.0/net/smtp.rb:975:in `check_auth_response'
[289612bd-42e0-4931-84d2-220260290edf] vendor/ruby-2.7.0/lib/ruby/2.7.0/net/smtp.rb:736:in `auth_plain'
[289612bd-42e0-4931-84d2-220260290edf] vendor/ruby-2.7.0/lib/ruby/2.7.0/net/smtp.rb:728:in `authenticate'
[289612bd-42e0-4931-84d2-220260290edf] vendor/ruby-2.7.0/lib/ruby/2.7.0/net/smtp.rb:565:in `do_start'
[289612bd-42e0-4931-84d2-220260290edf] vendor/ruby-2.7.0/lib/ruby/2.7.0/net/smtp.rb:518:in `start'
[289612bd-42e0-4931-84d2-220260290edf] mail (2.7.1) lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'


My domain and sender are authenticated with sendgrid.

I assume that I'm missing a super obvious setting somewhere. 
Chris Oliver
The username being "apikey" is such a strange one. I always wondered why they did that. 

I just updated the template to include a comment not to change the username. 
Notifications
You’re not receiving notifications from this thread.