feat: Prefer reply-to over from in email channels (#3837)

Co-authored-by: root <root@support.loomio.com>
This commit is contained in:
Robert Guthrie 2022-02-11 02:50:30 +13:00 committed by GitHub
parent 4201b57315
commit e9a162e71a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,11 +91,11 @@ class MailPresenter < SimpleDelegator
def from
# changing to downcase to avoid case mismatch while finding contact
@mail.from.map(&:downcase)
(@mail.reply_to.presence || @mail.from).map(&:downcase)
end
def sender_name
Mail::Address.new(@mail[:from].value).name
Mail::Address.new((@mail[:reply_to] || @mail[:from]).value).name
end
def original_sender