Created
August 24, 2018 04:58
-
-
Save JackGJenkins/b285f4d7a8dcf3fe9f454be6532d3192 to your computer and use it in GitHub Desktop.
Host this file (or one like it) on your server, and you can use it to unsubscribe a user in Intercom from other sources. For example, by adding a link in an email sent from another app, or directly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta name="robots" content="noindex, nofollow" /> | |
<link rel="stylesheet" media="screen, projection" href="https://static.intercomassets.com/assets/unsubscribe-eb55a149a7ee2dbea877ffb83e6db0c0c66e6658fd96b802a2d4aad6ebcc7502.css" /> | |
</head> | |
<body> | |
<div id="unsubscribe"> | |
<h2>Your App Name Here</h2> | |
<div class="unsubscribed"> | |
<h1>You are now unsubscribed</h1> | |
</div> | |
<p>Unsubscribed by accident? <a href="#" onclick="Intercom('showNewMessage', 'I have unsubscribed by accident, can you help?')">Let us know!</a></p> | |
</div> | |
<script> | |
(function(){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/qm41x107';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})() | |
var url_string = window.location.href; | |
var url = new URL(url_string); | |
var id = url.searchParams.get("id"); | |
// Add your workspace ID here. For instructions on how to find out it, check out Ruairí's doc: https://www.intercom.com/help/faqs-and-troubleshooting/getting-set-up/where-can-i-find-my-workspace-id-app-id | |
var workspace_id = "" | |
window.intercomSettings = { | |
app_id: workspace_id, | |
user_id: id, | |
unsubscribed_from_emails: true | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment