From 8541033ba9d0b832ac482d28ecd2e61c97462d99 Mon Sep 17 00:00:00 2001 From: iCross Date: Wed, 29 May 2013 20:54:22 +0800 Subject: [PATCH] ask module: send mail on development --- config/environments/development.rb | 25 +++++++++---------- .../ask/back_end/ask_replies_controller.rb | 4 +-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index ed5dc3a6..7daa02fc 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -21,7 +21,7 @@ Orbit::Application.configure do config.active_support.deprecation = :log # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin + config.action_dispatch.best_standards_support = :builtin # config.cache_store = :mem_cache_store @@ -33,17 +33,16 @@ Orbit::Application.configure do # :email_prefix => "[R4_error]", # :sender_address => %{"notifier" }, # :exception_recipients => %w{chris@rulingcom.com} - - # config.action_mailer.delivery_method = :smtp - # config.action_mailer.smtp_settings = { - # :tls => true, - # :enable_starttls_auto => true, - # :address => "smtp.gmail.com", - # :port => '587', - # :domain => "smtp.gmail.com", - # :authentication => "plain", - # :user_name => "redmine@rulingcom.com", - # :password => "rulingredmine" } - + + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + :enable_starttls_auto => true, + :address => "smtp.gmail.com", + :port => '587', + :domain => "smtp.gmail.com", + :authentication => "plain", + :user_name => "redmine@rulingcom.com", + :password => "rulingredmine" } + end diff --git a/vendor/built_in_modules/ask/app/controllers/panel/ask/back_end/ask_replies_controller.rb b/vendor/built_in_modules/ask/app/controllers/panel/ask/back_end/ask_replies_controller.rb index 7804bbb6..6427af00 100644 --- a/vendor/built_in_modules/ask/app/controllers/panel/ask/back_end/ask_replies_controller.rb +++ b/vendor/built_in_modules/ask/app/controllers/panel/ask/back_end/ask_replies_controller.rb @@ -13,7 +13,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController @ask_question.ask_reply = AskReply.new(params[:ask_reply]) @ask_question.save if @ask_question.ask_reply.send_email? - ::AskMailer.reply(@ask_question).deliver + Resque.enqueue(SendAskReplyMail, @ask_reply.ask_question.id) end redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success') end @@ -22,7 +22,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController @ask_reply = AskReply.find(params[:id]) @ask_reply.update_attributes(params[:ask_reply]) if @ask_reply.send_email? - Resque.enqueue(SendAskReplyMail, @reply.ask_question.id) + Resque.enqueue(SendAskReplyMail, @ask_reply.ask_question.id) end redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success') end