Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

rails_apps_composer: set email accounts

  • Loading branch information...
commit 6c9193a271e003afb27dfee0d516f9e1bd30b6ad 1 parent 5716436
Nathan Hurst authored March 17, 2013
21  config/environments/development.rb
@@ -13,8 +13,25 @@
13 13
   config.consider_all_requests_local       = true
14 14
   config.action_controller.perform_caching = false
15 15
 
16  
-  # Don't care if the mailer can't send
17  
-  config.action_mailer.raise_delivery_errors = false
  16
+  # ActionMailer Config
  17
+  config.action_mailer.default_url_options = { :host => 'localhost:3000' }
  18
+  config.action_mailer.delivery_method = :smtp
  19
+  # change to true to allow email to be sent during development
  20
+  config.action_mailer.perform_deliveries = false
  21
+  config.action_mailer.raise_delivery_errors = true
  22
+  config.action_mailer.default :charset => "utf-8"
  23
+
  24
+  config.action_mailer.smtp_settings = {
  25
+    address: "smtp.gmail.com",
  26
+    port: 587,
  27
+    domain: "example.com",
  28
+    authentication: "plain",
  29
+    enable_starttls_auto: true,
  30
+    user_name: ENV["GMAIL_USERNAME"],
  31
+    password: ENV["GMAIL_PASSWORD"]
  32
+  }
  33
+
  34
+
18 35
 
19 36
   # Print deprecation notices to the Rails logger
20 37
   config.active_support.deprecation = :log
20  config/environments/production.rb
@@ -61,6 +61,26 @@
61 61
   # Send deprecation notices to registered listeners
62 62
   config.active_support.deprecation = :notify
63 63
 
  64
+  config.action_mailer.default_url_options = { :host => 'example.com' }
  65
+  # ActionMailer Config
  66
+  # Setup for production - deliveries, no errors raised
  67
+  config.action_mailer.delivery_method = :smtp
  68
+  config.action_mailer.perform_deliveries = true
  69
+  config.action_mailer.raise_delivery_errors = false
  70
+  config.action_mailer.default :charset => "utf-8"
  71
+
  72
+  config.action_mailer.smtp_settings = {
  73
+    address: "smtp.gmail.com",
  74
+    port: 587,
  75
+    domain: "example.com",
  76
+    authentication: "plain",
  77
+    enable_starttls_auto: true,
  78
+    user_name: ENV["GMAIL_USERNAME"],
  79
+    password: ENV["GMAIL_PASSWORD"]
  80
+  }
  81
+
  82
+
  83
+
64 84
   # Log the query plan for queries taking more than this (works
65 85
   # with SQLite, MySQL, and PostgreSQL)
66 86
   # config.active_record.auto_explain_threshold_in_seconds = 0.5
4  config/environments/test.rb
@@ -34,4 +34,8 @@
34 34
 
35 35
   # Print deprecation notices to the stderr
36 36
   config.active_support.deprecation = :stderr
  37
+
  38
+  # ActionMailer Config
  39
+  config.action_mailer.default_url_options = { :host => 'example.com' }
  40
+
37 41
 end

0 notes on commit 6c9193a

Please sign in to comment.
Something went wrong with that request. Please try again.