diff --git a/app/mailers/notification_mailers/also_commented.rb b/app/mailers/notification_mailers/also_commented.rb index aa063cfa8..c6c4da8de 100644 --- a/app/mailers/notification_mailers/also_commented.rb +++ b/app/mailers/notification_mailers/also_commented.rb @@ -7,7 +7,6 @@ module NotificationMailers @comment = Comment.find_by_id(comment_id) if mail? - @headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>" @headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>" if @comment.public? @headers[:subject] = "Re: #{@comment.comment_email_subject}" diff --git a/app/mailers/notification_mailers/comment_on_post.rb b/app/mailers/notification_mailers/comment_on_post.rb index 4782f52b2..c9957e86f 100644 --- a/app/mailers/notification_mailers/comment_on_post.rb +++ b/app/mailers/notification_mailers/comment_on_post.rb @@ -5,7 +5,6 @@ module NotificationMailers def set_headers(comment_id) @comment = Comment.find(comment_id) - @headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>" @headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>" if @comment.public? @headers[:subject] = "Re: #{@comment.comment_email_subject}" diff --git a/app/mailers/notification_mailers/private_message.rb b/app/mailers/notification_mailers/private_message.rb index 9cbe71dc3..60a5013e8 100644 --- a/app/mailers/notification_mailers/private_message.rb +++ b/app/mailers/notification_mailers/private_message.rb @@ -3,11 +3,10 @@ module NotificationMailers attr_accessor :message, :conversation, :participants def set_headers(message_id) - @message = Message.find_by_id(message_id) + @message = Message.find_by_id(message_id) @conversation = @message.conversation @participants = @conversation.participants - @headers[:from] = "\"#{@message.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>" @headers[:subject] = I18n.t("notifier.private_message.subject") @headers[:in_reply_to] = @headers[:references] = "<#{@conversation.guid}@#{AppConfig.pod_uri.host}>" end diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index eb871f7cd..3adaca132 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -281,7 +281,9 @@ describe Notifier, type: :mailer do let(:comment) { eve.comment!(commented_post, "Totally is") } describe ".comment_on_post" do - let(:comment_mail) { Notifier.send_notification("comment_on_post", bob.id, person.id, comment.id).deliver_now } + let(:comment_mail) { + Notifier.send_notification("comment_on_post", bob.id, eve.person.id, comment.id).deliver_now + } it "TO: goes to the right person" do expect(comment_mail.to).to eq([bob.email]) @@ -322,7 +324,7 @@ describe Notifier, type: :mailer do end describe ".also_commented" do - let(:comment_mail) { Notifier.send_notification("also_commented", bob.id, person.id, comment.id) } + let(:comment_mail) { Notifier.send_notification("also_commented", bob.id, eve.person.id, comment.id) } it "TO: goes to the right person" do expect(comment_mail.to).to eq([bob.email])