0

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 ... !

2 Answers2

1

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.

Community
  • 1
  • 1
Christian Ternus
  • 8,406
  • 24
  • 39
0

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>
John
  • 11,985
  • 3
  • 45
  • 60
  • so what will be its output ? –  Sep 20 '13 at 19:01
  • Not sure what you mean in the comment. Visit the url and it gives you the option to follow CNN on twitter. Replace CNN in the url with your twitter name instead. Put that in your standard `href=""` tag. – John Sep 20 '13 at 19:22
  • should it be Follow us ? will i have to add @ with CNN how does it get without that ? –  Sep 20 '13 at 19:41
  • Please write down exact line i really need to do it urgently , –  Sep 20 '13 at 19:46
  • ah thats great , Thank u very much john –  Sep 20 '13 at 20:45