Move email configuration out of the model and into the config file
authorAndy Allan <andy@gravitystorm.co.uk>
Sat, 1 May 2010 11:36:22 +0000 (12:36 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Sat, 1 May 2010 11:36:22 +0000 (12:36 +0100)
app/models/notifier.rb
config/environment.rb

index df30d651bd75ce4d678ee12ec799587f202b8cb8..41734bb5b21e1954d35d6052b41905df225c0768 100644 (file)
@@ -99,8 +99,8 @@ private
   def common_headers(recipient)
     recipients recipient.email
     locale recipient.preferred_language_from(I18n.available_locales)
-    from "OpenStreetMap <webmaster@openstreetmap.org>"
-    headers "return-path" => "bounces@openstreetmap.org",
+    from EMAIL_FROM
+    headers "return-path" => EMAIL_RETURN_PATH,
             "Auto-Submitted" => "auto-generated"
   end
 
index 539af83b2971842a09296fe6456493c4c79e3571..018e97451501ceacab36f74ac7e5148e2f6cb449 100644 (file)
@@ -13,6 +13,10 @@ SERVER_URL = ENV['OSM_SERVER_URL'] || 'www.openstreetmap.org'
 # Set the generator
 GENERATOR = ENV['OSM_SERVER_GENERATOR'] || 'OpenStreetMap server'
 
+# Settings for generated emails (e.g. signup confirmation
+EMAIL_FROM = ENV['OSM_EMAIL_FROM'] || 'OpenStreetMap <webmaster@openstreetmap.org>'
+EMAIL_RETURN_PATH = ENV['OSM_EMAIL_RETURN_PATH'] || 'bounces@openstreetmap.org'
+
 # Application constants needed for routes.rb - must go before Initializer call
 API_VERSION = ENV['OSM_API_VERSION'] || '0.6'