Hi, has anyone integrated Freshdesk and Meteor?
They have a “Feedback Widget” that should install with this code, but it doesn’t.
<script type="text/javascript" src="http://assets.freshdesk.com/widget/freshwidget.js"></script>
<script type="text/javascript">
FreshWidget.init("", {"queryString": "&widgetType=popup", "utf8": "✓", "widgetType": "popup", "buttonType": "text", "buttonText": "Support", "buttonColor": "black", "buttonBg": "#5bc0de", "alignment": "4", "offset": "235px", "formHeight": "500px", "url": "https://support.freshdesk.com"} );
</script>
I meteorized it into a meteor create
test repo, but couldn’t get it to do anything.
Anything obviously wrong with my code? Thanks!
<head>
<title>freshdesk</title>
<script type="text/javascript" src="https://s3.amazonaws.com/assets.freshdesk.com/widget/freshwidget.js"></script>
</head>
<body>
<h1>Welcome to Meteor!</h1>
{{> hello}}
</body>
<template name="hello">
<button>Click Me</button>
<p>You've pressed the button {{counter}} times.</p>
</template>
Helpers = {};
Helpers.showSupportPopup = function(){
console.log(FreshWidget);
console.log(
FreshWidget.init("", {"queryString": "&widgetType=popup", "utf8": "✓", "widgetType": "popup", "buttonType": "text", "buttonText": "Support", "buttonColor": "black", "buttonBg": "#5bc0de", "alignment": "4", "offset": "235px", "formHeight": "500px", "url": "https://support.freshdesk.com"} ) //jshint ignore:line
);
};
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.hello.helpers({
counter: function () {
return Session.get('counter');
}
});
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
Session.set('counter', Session.get('counter') + 1);
}
});
Template.hello.onRendered(Helpers.showSupportPopup);
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}