I'm trying to set up active mailer functionality in my Rails app with Devise and SendGrid so that users can receive a confirmation email when they sign up and can request a forgot password link. When I deploy to Heroku and try and sign up I get an error when I hit 'sign up'. In the Heroku logs the I can see that there is an error as follows:
Completed 500 Internal Server Error in 547ms (ActiveRecord: 8.1ms)
Net::SMTPAuthenticationError (535 Authentication failed: Bad username / password
It's probably something to do with the way I have my config files but I can't put my finger on it. Any help would be massively appreciated! Here are my files.
config/application.yml
production:
SECRET_KEY_BASE: <%= ENV["SECRET_KEY_BASE"] %>
development:
GMAIL_USERNAME: scott.ian.munro@gmail.com
GMAIL_PASSWORD: password
SENDGRID_USERNAME: app115625999@heroku.com
SENDGRID_PASSWORD: password
test:
GMAIL_USERNAME: scott.ian.munro@gmail.com
GMAIL_PASSWORD: password
SENDGRID_USERNAME: app115625999@heroku.com
SENDGRID_PASSWORD: password
production:
GMAIL_USERNAME: scott.ian.munro@gmail.com
GMAIL_PASSWORD: password
SENDGRID_USERNAME: app115625999@heroku.com
SENDGRID_PASSWORD: password
I'm using the figaro
gem to manage my environment variables.