简体   繁体   中英

Twiiter Follow Button For Newsletter / Html email

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

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>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM