fix: Fetch email address to create contact (#4952)

Get the email address from the email content in the correct format.

Fixes: chatwoot/product#454
This commit is contained in:
Tejaswini Chile
2022-07-02 17:40:28 +05:30
committed by GitHub
parent ac7ebe516a
commit 97bf5d0c6a
3 changed files with 649 additions and 1 deletions

View File

@@ -114,7 +114,11 @@ class MailPresenter < SimpleDelegator
end
def original_sender
@mail[:reply_to].try(:value) || @mail['X-Original-Sender'].try(:value) || from.first
from_email_address(@mail[:reply_to].try(:value)) || @mail['X-Original-Sender'].try(:value) || from_email_address(from.first)
end
def from_email_address(email)
Mail::Address.new(email).address
end
def email_forwarded_for