I have a Ruby on Rails (v4.1.5) application running on RedHat’s OpenShift. I was in the process of switching from Mandrill to SendGrid. In development I was able to add the following to my development.rb config file:
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => 587,
:authentication => "plain",
:domain => ENV["DOMAIN_NAME"],
:enable_starttls_auto => true,
:user_name => ENV["SENDGRID_USERNAME"],
:password => ENV["SENDGRID_PASSWORD"]
}
And I could continue to use ActionMailer the same way I did before. I tested it locally and received emails and the headers showed they came through sendgrid.
Then I added this same code to production.rb and deployed to OpenShift. I added the new SENDGRID username and password environment variables used in the code above and verified they were set correctly on OpenShift.
But when I tested it, the log file says it sent the email to the correct email address but it doesn’t show up on my SendGrid dashboard and I have not received the email.
Does anyone know of any other log files on OpenShift that might show more info? I only looked at app-root/runtime/repo/log/production.log.
I have tried removing the enable_starttls_auto field above but nothing changed.
How can I debug this problem? I don’t know if it’s on the OpenShift side or SendGrid.