Remove unused From headers
It is already added in the default_headers
This commit is contained in:
parent
97c351c7b4
commit
eac8c7572c
4 changed files with 5 additions and 6 deletions
|
|
@ -7,7 +7,6 @@ module NotificationMailers
|
||||||
@comment = Comment.find_by_id(comment_id)
|
@comment = Comment.find_by_id(comment_id)
|
||||||
|
|
||||||
if mail?
|
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}>"
|
@headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>"
|
||||||
if @comment.public?
|
if @comment.public?
|
||||||
@headers[:subject] = "Re: #{@comment.comment_email_subject}"
|
@headers[:subject] = "Re: #{@comment.comment_email_subject}"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ module NotificationMailers
|
||||||
def set_headers(comment_id)
|
def set_headers(comment_id)
|
||||||
@comment = Comment.find(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}>"
|
@headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>"
|
||||||
if @comment.public?
|
if @comment.public?
|
||||||
@headers[:subject] = "Re: #{@comment.comment_email_subject}"
|
@headers[:subject] = "Re: #{@comment.comment_email_subject}"
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@ module NotificationMailers
|
||||||
attr_accessor :message, :conversation, :participants
|
attr_accessor :message, :conversation, :participants
|
||||||
|
|
||||||
def set_headers(message_id)
|
def set_headers(message_id)
|
||||||
@message = Message.find_by_id(message_id)
|
@message = Message.find_by_id(message_id)
|
||||||
@conversation = @message.conversation
|
@conversation = @message.conversation
|
||||||
@participants = @conversation.participants
|
@participants = @conversation.participants
|
||||||
|
|
||||||
@headers[:from] = "\"#{@message.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
|
|
||||||
@headers[:subject] = I18n.t("notifier.private_message.subject")
|
@headers[:subject] = I18n.t("notifier.private_message.subject")
|
||||||
@headers[:in_reply_to] = @headers[:references] = "<#{@conversation.guid}@#{AppConfig.pod_uri.host}>"
|
@headers[:in_reply_to] = @headers[:references] = "<#{@conversation.guid}@#{AppConfig.pod_uri.host}>"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,9 @@ describe Notifier, type: :mailer do
|
||||||
let(:comment) { eve.comment!(commented_post, "Totally is") }
|
let(:comment) { eve.comment!(commented_post, "Totally is") }
|
||||||
|
|
||||||
describe ".comment_on_post" do
|
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
|
it "TO: goes to the right person" do
|
||||||
expect(comment_mail.to).to eq([bob.email])
|
expect(comment_mail.to).to eq([bob.email])
|
||||||
|
|
@ -322,7 +324,7 @@ describe Notifier, type: :mailer do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".also_commented" do
|
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
|
it "TO: goes to the right person" do
|
||||||
expect(comment_mail.to).to eq([bob.email])
|
expect(comment_mail.to).to eq([bob.email])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue