chore: Add Chatwoot SDK to Chatwoot Dashboard (#1726)

Add Chatwoot SDK to Chatwoot Dashboard
This commit is contained in:
Pranav Raj S
2021-02-08 16:38:35 +05:30
committed by GitHub
parent f46c4b5130
commit d4c2a78db6
14 changed files with 481 additions and 266 deletions

View File

@@ -51,5 +51,27 @@
<div id="app"></div>
<noscript id="noscript">This app works best with JavaScript enabled.</noscript>
<%= yield %>
<% @global_config['CHATWOOT_INBOX_TOKEN'] %>
<% if @global_config['CHATWOOT_INBOX_TOKEN'] %>
<script>
window.chatwootSettings = {
hideMessageBubble: true,
position: 'left',
};
(function(d,t) {
var BASE_URL="";
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=BASE_URL+"/packs/js/sdk.js";
s.parentNode.insertBefore(g,s);
s.async=!0;
g.onload=function(){
window.chatwootSDK.run({
websiteToken: '<%= @global_config['CHATWOOT_INBOX_TOKEN'] %>',
baseUrl: BASE_URL,
});
}
})(document,"script");
</script>
<% end %>
</body>
</html>