feat: Custom fields in pre-chat form (#4135)

Fixes: #2744
This commit is contained in:
Muhsin Keloth
2022-03-14 15:06:56 +05:30
committed by GitHub
parent 578414d788
commit e730804b48
16 changed files with 328 additions and 137 deletions

View File

@@ -68,7 +68,7 @@ class Api::V1::Widget::BaseController < ApplicationController
mergee_contact: @contact
).perform
else
@contact.update!(email: email, name: contact_name)
@contact.update!(email: email, name: contact_name, phone_number: contact_phone_number)
end
end
@@ -80,6 +80,10 @@ class Api::V1::Widget::BaseController < ApplicationController
params[:contact][:name] || contact_email.split('@')[0]
end
def contact_phone_number
params[:contact][:phone_number]
end
def browser_params
{
browser_name: browser.name,