chore: Use the name of the sender from the mail object

if the sender email is Sony Mathew <Sony@chatwoot.com> Contact should be built with Sony Mathew

Fixes #2911
This commit is contained in:
Tejaswini Chile
2021-09-16 13:26:52 +05:30
committed by GitHub
parent 799e0ed4f5
commit a0ffefad71
4 changed files with 653 additions and 1 deletions

View File

@@ -82,6 +82,10 @@ class MailPresenter < SimpleDelegator
@mail.from.map(&:downcase)
end
def sender_name
Mail::Address.new(@mail[:from].value).name
end
def original_sender
@mail['X-Original-Sender'].try(:value) || from.first
end