From 86347cab8924b8538fe276964f414baff34c83c8 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 27 Apr 2015 16:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E5=8F=AF=E4=BB=A5=E9=80=9A?= =?UTF-8?q?=E8=BF=87rake=20redmine:email:test[guange]=20=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 2 +- config/configuration.yml | 17 +++++++++-------- lib/tasks/email.rake | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index eacead013..a930b5467 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -817,12 +817,12 @@ class Mailer < ActionMailer::Base headers[:references] = @references_objects.collect {|o| "<#{self.class.message_id_for(o)}>"}.join(' ') end + set_language_if_valid @initial_language super headers do |format| format.text format.html unless Setting.plain_text_mail? end - set_language_if_valid @initial_language end def initialize(*args) diff --git a/config/configuration.yml b/config/configuration.yml index 5eba1c71d..87a54a976 100644 --- a/config/configuration.yml +++ b/config/configuration.yml @@ -215,11 +215,12 @@ production: # specific configuration options for development environment # that overrides the default ones development: - delivery_method: :smtp - smtp_settings: - address: mail.trustie.net - port: 25 - domain: mail.trustie.net - authentication: :login - user_name: "mail@trustie.net" - password: "loong2010" + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake index 5f9bf7769..5126d7a69 100644 --- a/lib/tasks/email.rake +++ b/lib/tasks/email.rake @@ -186,9 +186,9 @@ END_DESC ActionMailer::Base.raise_delivery_errors = true begin - Mailer.with_synched_deliveries do - Mailer.test_email(user).deliver - end + # Mailer.with_synched_deliveries do + Mailer.test_email(user).deliver! + # end puts l(:notice_email_sent, user.mail) rescue Exception => e abort l(:notice_email_error, e.message)