diff --git a/app/mailers/notification_mailers/mentioned_in_comment.rb b/app/mailers/notification_mailers/mentioned_in_comment.rb index abb346ea8..0e9a51bba 100644 --- a/app/mailers/notification_mailers/mentioned_in_comment.rb +++ b/app/mailers/notification_mailers/mentioned_in_comment.rb @@ -5,6 +5,7 @@ module NotificationMailers def set_headers(target_id) # rubocop:disable Style/AccessorMethodName @comment = Mention.find_by_id(target_id).mentions_container + @headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>" @headers[:subject] = I18n.t("notifier.mentioned.subject", name: @sender.name) end end diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index 2ded0d80f..eb871f7cd 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -120,6 +120,11 @@ describe Notifier, type: :mailer do expect(mail.subject).to include(comment.author.name) end + it "IN-REPLY-TO and REFERENCES: references the commented post" do + expect(mail.in_reply_to).to eq("#{comment.parent.guid}@#{AppConfig.pod_uri.host}") + expect(mail.references).to eq("#{comment.parent.guid}@#{AppConfig.pod_uri.host}") + end + it "has the comment link in the body" do expect(mail.body.encoded).to include(post_url(comment.parent, anchor: comment.guid)) end