feat: Add pre_chat_form_settings in inbox settings page (#1776)

This commit is contained in:
Pranav Raj S
2021-02-16 00:58:57 +05:30
committed by GitHub
parent 3ade7d4445
commit 1706199a0e
9 changed files with 188 additions and 12 deletions

View File

@@ -18,4 +18,8 @@ json.phone_number resource.channel.try(:phone_number)
json.selected_feature_flags resource.channel.try(:selected_feature_flags)
json.reply_time resource.channel.try(:reply_time)
json.reauthorization_required resource.channel.try(:reauthorization_required?) if resource.facebook?
json.hmac_token resource.channel.try(:hmac_token) if resource.web_widget?
if resource.web_widget?
json.hmac_token resource.channel.try(:hmac_token)
json.pre_chat_form_enabled resource.channel.try(:pre_chat_form_enabled)
json.pre_chat_form_options resource.channel.try(:pre_chat_form_options)
end

View File

@@ -35,10 +35,12 @@ window.chatwootSettings = {
window.addEventListener('chatwoot:ready', function() {
console.log(window.$chatwoot);
window.$chatwoot.setUser('<%= user_id %>', {
identifier_hash: '<%= user_hash %>',
email: 'jane@example.com',
name: 'Jane Doe'
});
if (window.location.search.includes('setUser')) {
window.$chatwoot.setUser('<%= user_id %>', {
identifier_hash: '<%= user_hash %>',
email: 'jane@example.com',
name: 'Jane Doe'
});
}
})
</script>