Pages

Wednesday, November 30, 2011

How To Add "Invite To Network" Button to an Email

View Comments

This is another posting from my colleague Romain Lienard. The first posting that I shared from him was a quick post that explained how to add a "Follow This Community" button to an email which helps accelerate adoption. In this post, Romain shares how to simply add a button to your email signature, for example, so that others can click it and invite you to be part of their network. This is another great example of using LotusScript with the IBM Connections API. And given I like to share a bunch of how-to's, I figured I would help spread the word on this one.

What follows is his entry:


This is the second part of my previous blog entry "Follow-this-community button"

In the same spirit, I wanted to do a button that let people invite me into their network in a simple click, because it can be a good way to drive adoption of Connections.

  

image

  

Here again, 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

  

image

  

image

  

3 - Copy & paste this code, after changing the YOUR_EMAIL with your email :

Sub Click(Source As Button)
     Dim objHttp   
     Set objHttp = CreateObject("Microsoft.XMLHTTP")
     url = |https://w3-connections.ibm.com/profiles/atom/connections.do?email=YOUR_EMAIL&connectionType=colleague|
     req = |<?xml version="1.0" encoding="UTF-8"?>
<entry
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
   <category term="connection"
   scheme="http://www.ibm.com/xmlns/prod/sn/type" />
   <category term="colleague"
   scheme="http://www.ibm.com/xmlns/prod/sn/connection/type" />
   <category term="pending"
   scheme="http://www.ibm.com/xmlns/prod/sn/status" />
   <content type="html">
   Please accept this invitation to be in my network of Connections colleagues (sent from Lotus Notes).
   </content>
</entry>|
     objHttp.open "POST", url, False, "", ""
     objHttp.setRequestHeader "Content-type", "text/xml"
     objHttp.send(req)
     Msgbox "Invitation has been sent !"
End Sub

  

Save your document, click on the button, and voila ! (note : you'll be prompted for your intranet password)

  

image

  

If you want to use this button every day, there is unfortunately no way to put it on the signature file BUT (thanks to Herbert Hilhorst for the tip) you can copy & paste your signature and the button you put on it from the current mail to the signature richtext editor (More...>Preferences>Signature). In this way, the button will be copied too. Don't forget to select Rich Text instead of HTML or file.


This button is now in my default signature :)



Very cool, huh? Here's the original link to his blog entry so you can say "thank you" :).

blog comments powered by Disqus