Question

I am codng html email where i am required to add a twiiter follow button such that the one who recieves email will press follow button from inbox and that will make him / her follow me on twitter i have follwing code

 <a href="https://twitter.com/myanme" class="twitter-follow-button" data-show-count="false">
Follow @myname
 </a>

    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
</script>

will it work like this or should i do something else please help me with it ... !

Was it helpful?

Solution 2

HTML email doesn't allow javascript, so you have to do it in the url using web intents:

https://twitter.com/intent/user?screen_name=CNN

Replace CNN with your user name.

Here is a full example:

<a href="https://twitter.com/intent/user?screen_name=CNN">Follow Us</a>

OTHER TIPS

I assume you got this from https://twitter.com/about/resources/buttons#follow.

Generally speaking HTML readers don't allow Javascript, meaning you'll just get the "Follow @myname" bare link. Your best bet is probably a static text link, a clickable image, or something fancy with CSS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top