Mailspring/internal_packages/worker-ui/static/feedback.html
Eben Freeman 01652ffb24 feat(feedback): intercom for feedback
Summary:
Caveat: If you submit feedback from one account, and then switch accounts and
submit feedback again, the data from the old account still gets passed. It
looks like that was true with the previous compose-a-draft-with-feedback action
too. Maybe you know how to fix this? I couldn't figure it out.

Test Plan: Try it out! Not sure how to usefully write specs.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2106
2015-10-03 22:05:20 -07:00

63 lines
2.2 KiB
HTML

<html lang="en">
<head>
<meta charset="UTF-8">
<title>Feedback</title>
<script>
(function() {
var query = location.search.substr(1);
var queryParams = {};
query.split("&").forEach(function(part) {
if (!part) return;
var item = part.split("=");
var key = item[0];
var val = decodeURIComponent(item[1])
queryParams[key] = val;
});
console.log(queryParams);
// Load the intercom widget.
var w = window;
var ic = w.Intercom;
if (typeof ic==="function") {
ic('reattach_activator');
ic('update', intercomSettings);
} else {
var d = document;
var i = function() { i.c(arguments) };
i.q = [];
i.c = function(args){ i.q.push(args) };
w.Intercom = i;
}
function l() {
var s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://widget.intercom.io/widget/t7k2sjgy';
var x = d.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s,x);
}
if (w.attachEvent) {
w.attachEvent('onload',l);
} else {
w.addEventListener('load', l, false);
}
// Show the intercom messaging window.
// Send along some extra info per
// http://docs.intercom.io/configuring-Intercom/send-custom-user-attributes-to-intercom
window.Intercom('boot', {
app_id: "t7k2sjgy",
email: queryParams.email,
name: queryParams.name,
"accountId": queryParams.accountId,
"platform": queryParams.platform,
"provider": queryParams.provider,
"organizational_unit": queryParams.organizational_unit,
"version": queryParams.version,
});
window.Intercom('show');
})();
</script>
</head>
<body></body></html>