diff --git a/app/mailers/notification_mailers/private_message.rb b/app/mailers/notification_mailers/private_message.rb index 6698ba64721addd0501e31579ab90d1e39627bac..ed40e70dd7efb2ad7a4c852f2d9ba93c5fcc7168 100644 --- a/app/mailers/notification_mailers/private_message.rb +++ b/app/mailers/notification_mailers/private_message.rb @@ -8,8 +8,7 @@ module NotificationMailers @participants = @conversation.participants @headers[:from] = "\"#{@message.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>" - @headers[:subject] = @conversation.subject.strip - @headers[:subject] = "Re: #{@headers[:subject]}" if @conversation.messages.size > 1 + @headers[:subject] = I18n.t("notifier.private_message.subject") end end end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index e5a89b8f4ec52178f4a5edf318310f45aaa6b791..6ebe773b7b6cacd318552af0043bcb5f84239919 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -683,6 +683,7 @@ en: subject: "%{name} has mentioned you on diaspora*" limited_post: "You were mentioned in a limited post." private_message: + subject: "There’s a new private message for you" reply_to_or_view: "Reply to or view this conversation >" liked: liked: "%{name} liked your post" diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index c3f80f5d2c80e4251ed69b7972b1a0108ef8468d..b9253a0fcc2eef38ca3018e6f1eb7e3cf1cdd061 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -212,15 +212,12 @@ describe Notifier, type: :mailer do expect(@mail["From"].to_s).to eq("\"#{@cnv.author.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>") end - it "SUBJECT: has a snippet of the post contents" do - expect(@mail.subject).to eq(@cnv.subject) + it "should use a generic subject" do + expect(@mail.subject).to eq(I18n.translate("notifier.private_message.subject")) end - it "SUBJECT: has 'Re:' if not the first message in a conversation" do - @cnv.messages << Message.new(text: "yo", author: eve.person) - @mail = Notifier.private_message(bob.id, @cnv.author.id, @cnv.messages.last.id) - - expect(@mail.subject).to eq("Re: #{@cnv.subject}") + it "SUBJECT: should not has a snippet of the private message contents" do + expect(@mail.subject).not_to eq(@cnv.subject) end it "BODY: does not contain the message text" do