Skip to content

Instantly share code, notes, and snippets.

@deskie-io
Last active July 12, 2023 10:07
Show Gist options
  • Save deskie-io/16faf4629fb05e62a69c7fc0516f3eab to your computer and use it in GitHub Desktop.
Save deskie-io/16faf4629fb05e62a69c7fc0516f3eab to your computer and use it in GitHub Desktop.
Advanced Features of Deskie Widget
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sample page with widget</title>
</head>
<body>
<div><a href="#" class="deskie-email-widget">Link for widget activation</a> while display_button: false</div>
<!-- Start of widget's main script (sample, use your code) -->
<script>
!function(e,o){!window.deskie?window.deskie=[]:'';window.deskie.push(o);o.g_config={widget_id:"[your_widget_id]"}; o.email_widget=o.email_widget||{};var w=o.email_widget;w.readyQueue=[];o.config=function(e){ this.g_config.user=e};w.ready=function(e){this.readyQueue.push(e)};var r=e.getElementsByTagName("script")[0];c=e.createElement("script");c.type="text/javascript",c.async=!0;c.src="https://deskie.io/bundles/acmesite/js/cwidget0.2.js";r.parentNode.insertBefore(c,r)}(document,[]);
</script>
<!-- End of widget's main script -->
<!-- Start of additional script for advanced features -->
<script>
deskie[0].config({
display_button: true, // name of the class while value is "false" - deskie-email-widget
user_info: false, // if value is "true" basic user info is added as a note
});
deskie[0].widget={ready: function() {
deskie[0].widget.identify={
'user_full_name': 'John Galt', //system field
'user_email': 'john.g@gmail.com', //system field
'user_phone': '+12025550166', //system field
'company_name': 'John Galt Solutions, Inc', //system field
'company_position': 'CEO', //system field
'user_note': 'Thinking about paying for the PRO package', //system field
'subject': 'Personal demo via Whereby', //system field
'priority': 2, //system field (1 - low, 2 - normal, 3 - high, 4 - critical)
'cf_39': 'web', //custom field (id can be received via API)
'cf_34': true, //custom field (id can be received via API)
'purchases': 12, //additional info which is added as a note
'Partner URL': 'http://robotsrule.com/info.html' //additional info which is added as a note
};
deskie[0].widget.hide=[
'user_full_name', //hides the fullname from the form if it is filled in via identify
'user_email', //hides the email from the form if it is filled in via identify
'subject' //hides the subject from the form if it is filled in via identify
];
deskie[0].widget.case_subject=[
'Question about product features',
'Initial setup',
'Personal demo via Whereby',
'Payment method'
];
deskie[0].widget.search = 'payment'
}};
</script>
<!-- End of additional script for advanced feature -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment