theKindOfMe

January 27, 2011

Switching Devise Mail Sender Address with the Environment

Filed under: Uncategorized — Tags: , , — yasi8h @ 7:04 am

This is something very simple that i took more than 5 minutes to find out 🙂

in file: config/initializers/devise.rb

if Rails.env.development?
config.mailer_sender = “no-reply@development.com”
elsif Rails.env.production?
config.mailer_sender = “no-reply@production.com”
end

Rails.env does the trick.

Advertisements

1 Comment »

  1. Thanks, works like a charm 🙂

    Comment by plentz — February 16, 2011 @ 12:33 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: