Wednesday, November 30, 2011

How To Add a "Follow Community" button in an Email

View Comments

I saw this posted internally and just felt compelled to share. My colleague, Romain Lienard, He developed a way to quickly add a button to an email so that recipients can quickly follow an IBM Connections Community with a single click. I can see this being very very handy, specially when combined with the community email newsletter generator. This is a great example of using LotusScript and the IBM Connections API.

What follows is a copy of Romain's blog entry:
















The IBM Connections API can be used with Lotus Notes and its LotusScript programming language in order to facilitate some tasks for end users.

So with some Notes support from Herbert Hilhorst, I wrote a piece of LotusScript that automatically follows a community with a simple click. The authentication is done directly in the Notes client


All you have to do is :

1 - create a button in your mail, via Create>Hotspot>Button.

2 - Specify a label for your button, select LotusScript instead of Formula











3 - Copy & paste this code, after changing the CommunityUID (here it's 5bf86449-cd87-4e02-bef5-a24f24408723) according to your needs :

Sub Click(Source As Button)
     Dim objHttp
     Set objHttp = CreateObject("Microsoft.XMLHTTP")
     url = ||
     req = |<entry>
<category term="resource-follow" scheme=""></category>
<category term="communities" scheme=""></category>
<category term="community" scheme=""></category>
<category term="5bf86449-cd87-4e02-bef5-a24f24408723" scheme=""></category>
</entry>| "POST", url, False, "", ""
     objHttp.setRequestHeader "Content-type", "text/xml"
     Msgbox "You're now following the TEC-F community. Thank you !"
End Sub


Save your document, click on the button, and voila ! Here's the original blog entry so you can give thanks to Romain :).


blog comments powered by Disqus