2
votes

I am running two Rails 3.1.0 apps on Heroku. One of these apps is just for staging purposes. I am using Devise for authentication and sendgrid to handle email.

When a user registers on the main app, the confirmation email seems to be sent fine. However, when the user clicks the confirmation link in the email, they are sent to the staging app instead. The link in the email is confirmation_url, which does not seem to be hard-coded to anything in my app.

Any ideas on why this might be occurring or suggestions on how to go about debugging?

1

1 Answers

7
votes

You've most likely set this in your config/environments/production.rb

# Email settings
config.action_mailer.default_url_options = { :host => "www.your-staging-server-url.com" }
config.action_mailer.smtp_settings = {
  :address        => 'smtp.sendgrid.net',
  :port           => '587',
  :authentication => :plain,
  :user_name      => ENV['SENDGRID_USERNAME'],
  :password       => ENV['SENDGRID_PASSWORD'],
  :domain         => 'heroku.com'
}