fix: Email collect overriding existing contact name (#7355)

Currently, if Enable email collect box is enabled, and the user starting the chat already has an account with the same email, it will override the current account with {name} from the email name@email.com , this fixes it.

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Luis
2023-06-22 07:39:12 -06:00
committed by GitHub
parent 82e5fc413e
commit 533f9f7fe4
2 changed files with 4 additions and 2 deletions

View File

@@ -17,7 +17,8 @@ class Api::V1::Widget::MessagesController < Api::V1::Widget::BaseController
@message.update!(submitted_email: contact_email)
ContactIdentifyAction.new(
contact: @contact,
params: { email: contact_email, name: contact_name }
params: { email: contact_email, name: contact_name },
retain_original_contact_name: true
).perform
else
@message.update!(message_update_params[:message])