From ea6909a6b0768e61e106efe0440fcbbd5c583e89 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 29 Nov 2013 12:03:16 +0800 Subject: [PATCH] Mailer now working in production added scope for pending users --- Gemfile | 1 + app/models/user/user.rb | 5 ++--- config/environments/production.rb | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 54f32939..fc32055b 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'time_difference' gem "acts_as_unvlogable" gem 'youtube_it' gem 'gotcha' +gem 'tlsmail' # gem "memcached", "~> 1.4.3" # gem "memcache-client" diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 999c5bc3..815ff355 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -62,10 +62,9 @@ class User :presence => { :message => I18n.t("users.user_id_not_null") } , :length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") }, :uniqueness => true + + scope :approval_pending, where(:approved => false) - def email_required? - false - end # validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique") # def new_attribute_values=(vars) diff --git a/config/environments/production.rb b/config/environments/production.rb index e2bf7f3a..e3c44cf0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,5 +1,6 @@ +require 'tlsmail' Orbit::Application.configure do - # Settings specified here will take precedence over those in config/application.rb + # Settings specified here will take precednece over those in config/application.rb # Code is not reloaded between requests config.cache_classes = false @@ -60,13 +61,15 @@ Orbit::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify - + Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) config.action_mailer.delivery_method = :smtp + config.action_mailer.perform_deliveries = true + config.action_mailer.raise_delivery_errors = false config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => "http://smtp.gmail.com", :port => '587', - :domain => "http://smtp.gmail.com", + :domain => "new.tp.rulingcom.com", :authentication => "plain", :user_name => "redmine@rulingcom.com", :password => "rulingredmine"