mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 20:18:08 +00:00
fix: Name missing when email is collected via email hook (#6530)
- The name is not updated when the email is updated via the email collect message. This PR fixes that.
This commit is contained in:
@@ -17,7 +17,7 @@ class Api::V1::Widget::MessagesController < Api::V1::Widget::BaseController
|
||||
@message.update!(submitted_email: contact_email)
|
||||
ContactIdentifyAction.new(
|
||||
contact: @contact,
|
||||
params: { email: contact_email }
|
||||
params: { email: contact_email, name: contact_name }
|
||||
).perform
|
||||
else
|
||||
@message.update!(message_update_params[:message])
|
||||
|
||||
@@ -138,6 +138,7 @@ RSpec.describe '/api/v1/widget/messages', type: :request do
|
||||
message.reload
|
||||
expect(message.submitted_email).to eq(email)
|
||||
expect(message.conversation.contact.email).to eq(email)
|
||||
expect(message.conversation.contact.name).to eq(email.split('@')[0])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user