I cannot access the env variables in the Rails console while they work in the application.
In .powenv
I have export SENDGRID_PASSWORD="123"
In config/initializers/mail.rb
there is:
ActionMailer::Base.smtp_settings = { :password => ENV['SENDGRID_PASSWORD'] }
So, in the console, when I type UserMailer.welcome_mail.deliver
, the error "ArgumentError: SMTP-AUTH requested, but there is no secret phrase" appears. However, it successfully sends mail from the application.
How can I make env variables available in the console?
source share