<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -11,4 +11,4 @@ ActionMailer::Base.smtp_settings = {
   :address  =&gt; &quot;localhost&quot;,
   :port  =&gt; 25,
   :domain  =&gt; 'clockingit.com'
-}
\ No newline at end of file
+}</diff>
      <filename>config/environment.local.rb</filename>
    </modified>
    <modified>
      <diff>@@ -116,7 +116,7 @@ ActionController::Base.session_options[:session_expires]= Time.local(2015,&quot;jan&quot;)
 require File.join(File.dirname(__FILE__), '../lib/rails_extensions')
 
 local_env = File.join(File.dirname(__FILE__), 'environment.local.rb')
-# load(local_env) if File.exists?(local_env)
+load(local_env) if File.exists?(local_env)
 
 require File.join(File.dirname(__FILE__), '../lib/misc.rb')
 
@@ -131,3 +131,48 @@ begin
 rescue
 #  puts $!
 end
+
+# If a value is set for ENV[env_name], sets hash[name]
+# to that value. If not, leaves hash[name] untouched
+def load_from_env(env_name, name, hash, &amp;block)
+  if ENV[env_name].present?
+    if block_given?
+      hash[name] = yield(ENV[env_name])
+    else
+      hash[name] = ENV[env_name] 
+    end
+  end
+end
+
+
+
+require &quot;pp&quot;
+
+# Load any action mailer settings from ENV
+ActionMailer::Base.smtp_settings ||= {}
+load_from_env(&quot;SMTP_HOSTNAME&quot;, :address, ActionMailer::Base.smtp_settings)
+load_from_env(&quot;SMTP_PORT&quot;, :port, ActionMailer::Base.smtp_settings) { |p| p.to_i }
+load_from_env(&quot;SMTP_DOMAIN&quot;, :domain, ActionMailer::Base.smtp_settings)
+load_from_env(&quot;SMTP_USER&quot;, :user_name, ActionMailer::Base.smtp_settings)
+load_from_env(&quot;SMTP_PASSWORD&quot;, :password, ActionMailer::Base.smtp_settings)
+load_from_env(&quot;SMTP_AUTHENTICATION&quot;, :authentication, ActionMailer::Base.smtp_settings)
+
+# Just for debugging while we get this working:
+puts &quot;ActionMailer Settings:&quot;
+pp ActionMailer::Base.smtp_settings
+puts &quot;\n&quot;
+
+# Load any $CONFIG settings from ENV
+$CONFIG ||= {}
+load_from_env(&quot;DOMAIN&quot;, :domain, $CONFIG)
+load_from_env(&quot;REPLYTO&quot;, :replyto, $CONFIG)
+load_from_env(&quot;FROM&quot;, :from, $CONFIG)
+load_from_env(&quot;PREFIX&quot;, :prefix, $CONFIG)
+load_from_env(&quot;PRODUCT_NAME&quot;, :productName, $CONFIG)
+load_from_env(&quot;USE_SSL&quot;, :SSL, $CONFIG) { |s| s == &quot;true&quot; }
+
+# Just for debugging while we get this working:
+puts &quot;$CONFIG:&quot;
+pp $CONFIG
+puts &quot;\n&quot;
+</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,7 @@ class NotificationsTest &lt; ActiveRecord::TestCase
       # need to hard code these configs because the fixtured have hard coded values
       $CONFIG[:domain] = &quot;clockingit.com&quot;
       $CONFIG[:email_domain] = $CONFIG[:domain].gsub(/:\d+/, '')
+      $CONFIG[:productName] = &quot;ClockingIT&quot;
 
       @expected = TMail::Mail.new
       @expected.set_content_type &quot;text&quot;, &quot;plain&quot;, { &quot;charset&quot; =&gt; CHARSET }</diff>
      <filename>test/unit/notifications_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,9 +10,9 @@ def self.config
     if File.exists?(file)
       @config = YAML::load_file(file)
     else
-      port = ENV[&quot;PUSH_PORT&quot;]
-      domain = ENV[&quot;PUSH_DOMAIN&quot;]
-      secret = ENV[&quot;PUSH_SECRET&quot;]
+      port = ENV[&quot;PUSH_PORT&quot;] || 443
+      domain = ENV[&quot;PUSH_DOMAIN&quot;] || &quot;localhost&quot; 
+      secret = ENV[&quot;PUSH_SECRET&quot;] || &quot;not_very_secret&quot;
 
       @config = {
         &quot;PUSH_PORT&quot; =&gt; port,</diff>
      <filename>vendor/plugins/juggernaut/lib/juggernaut.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>25ef9bd6bdb756a0eee08a0e7a799dc9355514e2</id>
    </parent>
  </parents>
  <author>
    <name>Brad Wilson</name>
    <email>brad@lucky-dip.net</email>
  </author>
  <url>http://github.com/bradx3/clockingit/commit/2c4917397a6b101e002daf6cc53abd7ed601035c</url>
  <id>2c4917397a6b101e002daf6cc53abd7ed601035c</id>
  <committed-date>2009-10-27T04:19:48-07:00</committed-date>
  <authored-date>2009-10-27T04:19:48-07:00</authored-date>
  <message>added support to load product settings and mail settings from ENV variables (see config/environment.rb for list)</message>
  <tree>dc3da6ae839742e1358d848a7c9fc2a3b0d4a59c</tree>
  <committer>
    <name>Brad Wilson</name>
    <email>brad@lucky-dip.net</email>
  </committer>
</commit>
