MS IZ the mailer will not be setup unless turned on in the APP_CONFIG

This commit is contained in:
zhitomirskiyi 2010-10-26 17:46:19 -07:00
parent fa484e95e4
commit 0b2e00b7d6
5 changed files with 5 additions and 16 deletions

View file

@ -13,6 +13,7 @@ default:
pubsub_server: 'https://pubsubhubbub.appspot.com/' pubsub_server: 'https://pubsubhubbub.appspot.com/'
mongo_host: 'localhost' mongo_host: 'localhost'
mongo_port: 27017 mongo_port: 27017
mailer_on: false
smtp_address: 'smtp.example.com' smtp_address: 'smtp.example.com'
smtp_port: '587' smtp_port: '587'
smtp_domain: 'mail.example.com' smtp_domain: 'mail.example.com'

View file

@ -20,7 +20,7 @@ Diaspora::Application.configure do
config.action_controller.perform_caching = false config.action_controller.perform_caching = false
# Don't care if the mailer can't send # Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log config.active_support.deprecation = :log
config.middleware.use MongoMapper::ClearDevMemory config.middleware.use MongoMapper::ClearDevMemory
#config.threadsafe! #config.threadsafe!

View file

@ -47,16 +47,4 @@ Diaspora::Application.configure do
# the I18n.default_locale when a translation can not be found) # the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true config.i18n.fallbacks = true
config.threadsafe! config.threadsafe!
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = {:host => 'pivots.joindiaspora.com'}
config.action_mailer.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'mail.joindiaspora.com',
:authentication => 'plain',
:user_name => 'diaspora-pivots@joindiaspora.com',
:password => "xy289|]G+R*-kA",
:enable_starttls_auto => true
}
end end

View file

@ -4,7 +4,7 @@
Diaspora::Application.configure do Diaspora::Application.configure do
config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]}
unless Rails.env == 'test' unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true
config.action_mailer.delivery_method = :smtp config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { config.action_mailer.smtp_settings = {
:address => APP_CONFIG[:smtp_address], :address => APP_CONFIG[:smtp_address],

View file

@ -71,14 +71,14 @@ module Diaspora
Rails.logger.info("#{self.real_name}'s friend request has been accepted") Rails.logger.info("#{self.real_name}'s friend request has been accepted")
friend_request.destroy friend_request.destroy
#Notifier.request_accepted(self, friend_request.person, aspect).deliver Notifier.request_accepted(self, friend_request.person, aspect).deliver
#this is a new friend request #this is a new friend request
else else
self.pending_requests << friend_request self.pending_requests << friend_request
self.save self.save
Rails.logger.info("#{self.real_name} has received a friend request") Rails.logger.info("#{self.real_name} has received a friend request")
friend_request.save friend_request.save
#Notifier.new_request(self, friend_request.person).deliver Notifier.new_request(self, friend_request.person).deliver
end end
end end