From 70408b9cb4e27df5587795dd96ee40ceec084f3b Mon Sep 17 00:00:00 2001 From: Francisco de Juan Date: Thu, 6 Jun 2013 08:19:51 +0200 Subject: [PATCH] Configure mailer using Mandrill --- config/environments/development.rb | 2 ++ config/environments/production.rb | 3 +++ config/initializers/devise.rb | 2 +- config/initializers/mail.rb | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 config/initializers/mail.rb diff --git a/config/environments/development.rb b/config/environments/development.rb index d18e8b5..e4a2bc5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -34,4 +34,6 @@ # Expands the lines which load the assets config.assets.debug = true + + config.action_mailer.default_url_options = { :host => 'padel.local:3000' } end diff --git a/config/environments/production.rb b/config/environments/production.rb index 11c9fdc..8eedabe 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -64,4 +64,7 @@ # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) # config.active_record.auto_explain_threshold_in_seconds = 0.5 + + config.action_mailer.default_url_options = { :host => 'padel.heroku.com' } + end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 5105812..ef91578 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -4,7 +4,7 @@ # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class with default "from" parameter. - config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com" + config.mailer_sender = "Padel " # Configure the class responsible to send e-mails. # config.mailer = "Devise::Mailer" diff --git a/config/initializers/mail.rb b/config/initializers/mail.rb new file mode 100644 index 0000000..9182f44 --- /dev/null +++ b/config/initializers/mail.rb @@ -0,0 +1,9 @@ +ActionMailer::Base.smtp_settings = { + :port => '587', + :address => 'smtp.mandrillapp.com', + :user_name => ENV['MANDRILL_USERNAME'], + :password => ENV['MANDRILL_APIKEY'], + :domain => 'heroku.com', + :authentication => :plain +} +ActionMailer::Base.delivery_method = :smtp \ No newline at end of file