Monday, September 17, 2012

Customizing Mail Messages in Extranet Collaboration Manager for SharePoint 2010 (ExCM)

by Matthew McBride

Extranet Collaboration Manager for SharePoint 2010 (ExCM), a comprehensive solution to manage and streamline the use of SharePoint 2010 extranets, uses a template-based mail messaging system. We provide four messages “out of the box:”

Each message is completely customizable, but the defaults are usually sufficient for the needs of most of our customers. Here is how the Invitation Message appears to an invitee. Notice the default hyperlinks:

The first link (“Demo” in this case) is simply a link to the site itself, and the name is generated from the title given during the initial creation within Central Administration. The second link takes the user to the actual registration page where they can enter their information:

We’ve all been guilty from time to time of not “reading the manual” thoroughly…especially in the IT world. :) Let’s assume for this post that the user receives the invitation and is so excited to join an ExCM-powered extranet site that they click the first link instead of “register.” Unless the root level site were anonymously accessible, they would be taken to the Sign In page for the site:

Since they have not yet created an account, they obviously cannot sign in. Also, because we are not allowing Anonymous Registration for this site, there is no link directly to the registration page available. Frustration sets in, and the user never follows through with their dream of becoming a registered user of an ExCM site.

Of course, this all could have been avoided if the invitee had just “read the manual” (or email in this case). So how can we prevent further dreams from being crushed in the future? By creating a custom template for the Invitation Mail Message that removes the hyperlink.

The first thing we need to do is create a new Mail Definitions list and item containing the customized template. To do this, we need to navigate to Site Actions – More Options:

From there, we select “Mail Definitions” and give the new list a name:

After clicking “Create,” we are taken to the new list. Now we to select “New Item” from the menu:

Now we need to give our new template a name, mail subject, and mail body. The first two are self-explanatory, but the mail body itself needs to be in HTML format. Here is a sample of the existing Invitation Mail Message found on our help site:

I am going to copy and paste that section into Notepad so we can take a closer look at the edits we need to make. In this scenario, I am looking for the following value:

<a href="$invitationWebUri.AbsoluteUri">$HttpUtility.HtmlEncode($invitationWeb.Title)</a>

I am just going to replace the entire reference with regular text so that it will now read:

“…the best ExCM-powered Extranet site on the planet!”

After that, I copy and paste our text from the Notepad file into the mail body area for the template:

After clicking “Save,” we can now see that our new template has been successfully created:

Now, let’s use this new template for our ExCM invitations. We'll navigate to Site Actions – Site Settings and select “Mail Settings” from the ExCM management menu. From there, we'll select the “Invitation” message under “Mail Messages:”

In the middle of the pop-up window, we need to select “Use Custom Template” and select the one we just created and click “Save:”

We can now see that the Invitation Mail Message is using our custom template:

Now, let’s test it out. After inviting another user and opening the email, we now see this:

Our custom template is now working and we have prevented future invitees from despair!

Of course, you can get MUCH more detailed in the customization of your messages. You can use HTML to change the colors and fonts, include graphics, etc. Regardless of complexity, however, the process remains the same.