diff --git a/app/models/mailer.rb b/app/models/mailer.rb index b96e46a24..aee837ac4 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -30,15 +30,17 @@ class Mailer < ActionMailer::Base # Builds a Mail::Message object used to email recipients of the added journals for message. # def journals_for_message_add(user, journals_for_message) - @user = User.current + @user = journals_for_message.user if journals_for_message.jour_type!="Project"&&journals_for_message.jour_type!="Bid" - - @mail = journals_for_message.jour - + if(journals_for_message.reply_id==0) + @mail = journals_for_message.jour + else + @mail = journals_for_message.at_user + end @message = journals_for_message.notes - @url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => @mail) - mail :to => @mail.mail, - :subject => "#@user leave your a message" + @url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => journals_for_message.jour) + str = "#{@user} #{t(:label_leave_your_message, :locale => 'zh')}" + mail :to => @mail.mail, :subject => str end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 5ac8cc9ff..fd44c577a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1260,6 +1260,7 @@ en: label_leave_me_message: left a message to me label_leave_others_message: leave message to him/her label_leave_a_message: Leave him/her a message: + label_leave_your_message: Leave a message to you label_new_activities: ' has new activity in' # modified by bai label_new_activity: ' has new activity in' label_i_new_activity: ' have new activity in' diff --git a/config/locales/zh.yml b/config/locales/zh.yml index aa72ed9fd..d73bb42f2 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1389,6 +1389,7 @@ zh: label_leave_me_message: 给我留言了 label_leave_others_message: 给他留言了 label_leave_a_message: 给他(她)留言 + label_leave_your_message: 给你留言了 label_new_activity: 有了最新动态 label_create_project: 参与了 label_praise: 赞