diff options
author | Dennis Schubert <mail@dennis-schubert.de> | 2016-09-25 06:38:28 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-09-25 21:15:16 +0300 |
commit | dfb5b717b688207da2d56f6c7eac7842fd664e41 (patch) | |
tree | b319d51f59903703a4f31a5bf3b6b8a9fcbb35d2 /app/mailers | |
parent | 6ca598e54ab33dc453ab9a585379aca6b29968a0 (diff) |
Add In-Reply-To and References headers to notification mails
closes #7122
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/notification_mailers/also_commented.rb | 1 | ||||
-rw-r--r-- | app/mailers/notification_mailers/comment_on_post.rb | 1 | ||||
-rw-r--r-- | app/mailers/notification_mailers/liked.rb | 1 | ||||
-rw-r--r-- | app/mailers/notification_mailers/mentioned.rb | 1 | ||||
-rw-r--r-- | app/mailers/notification_mailers/private_message.rb | 1 | ||||
-rw-r--r-- | app/mailers/notification_mailers/reshared.rb | 3 |
6 files changed, 7 insertions, 1 deletions
diff --git a/app/mailers/notification_mailers/also_commented.rb b/app/mailers/notification_mailers/also_commented.rb index 15914d25a..aa063cfa8 100644 --- a/app/mailers/notification_mailers/also_commented.rb +++ b/app/mailers/notification_mailers/also_commented.rb @@ -8,6 +8,7 @@ module NotificationMailers 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}" else diff --git a/app/mailers/notification_mailers/comment_on_post.rb b/app/mailers/notification_mailers/comment_on_post.rb index 1ad0a5f0f..4782f52b2 100644 --- a/app/mailers/notification_mailers/comment_on_post.rb +++ b/app/mailers/notification_mailers/comment_on_post.rb @@ -6,6 +6,7 @@ module NotificationMailers @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}" else diff --git a/app/mailers/notification_mailers/liked.rb b/app/mailers/notification_mailers/liked.rb index 54e89ef90..c9067bf74 100644 --- a/app/mailers/notification_mailers/liked.rb +++ b/app/mailers/notification_mailers/liked.rb @@ -7,6 +7,7 @@ module NotificationMailers @like = Like.find(like_id) @headers[:subject] = I18n.t('notifier.liked.liked', :name => @sender.name) + @headers[:in_reply_to] = @headers[:references] = "<#{@like.parent.guid}@#{AppConfig.pod_uri.host}>" end end end diff --git a/app/mailers/notification_mailers/mentioned.rb b/app/mailers/notification_mailers/mentioned.rb index dc64f65b0..a06c82e75 100644 --- a/app/mailers/notification_mailers/mentioned.rb +++ b/app/mailers/notification_mailers/mentioned.rb @@ -7,6 +7,7 @@ module NotificationMailers @post = Mention.find_by_id(target_id).post @headers[:subject] = I18n.t('notifier.mentioned.subject', :name => @sender.name) + @headers[:in_reply_to] = @headers[:references] = "<#{@post.guid}@#{AppConfig.pod_uri.host}>" end end end diff --git a/app/mailers/notification_mailers/private_message.rb b/app/mailers/notification_mailers/private_message.rb index ed40e70dd..9cbe71dc3 100644 --- a/app/mailers/notification_mailers/private_message.rb +++ b/app/mailers/notification_mailers/private_message.rb @@ -9,6 +9,7 @@ module NotificationMailers @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 end end diff --git a/app/mailers/notification_mailers/reshared.rb b/app/mailers/notification_mailers/reshared.rb index 4ea24e13d..e98b986ab 100644 --- a/app/mailers/notification_mailers/reshared.rb +++ b/app/mailers/notification_mailers/reshared.rb @@ -1,13 +1,14 @@ module NotificationMailers class Reshared < NotificationMailers::Base attr_accessor :reshare - + delegate :root, to: :reshare, prefix: true def set_headers(reshare_id) @reshare = Reshare.find(reshare_id) @headers[:subject] = I18n.t('notifier.reshared.reshared', :name => @sender.name) + @headers[:in_reply_to] = @headers[:references] = "<#{@reshare.root_guid}@#{AppConfig.pod_uri.host}>" end end end |