Partager via


Is it possible to modify SharePoint email notifications?

Last month a customer asked me if they could modify SharePoint alert notifications? Of course you can was my confident answer! My understanding being they wished to customise the emails sent by SharePoint via e-mail subscription notification service in wss 3.0. This covers changes made to list items (item level alert), documents, lists (list level alert) or document libraries, basically any SharePoint list type. However, this was not the case! The customer was already pretty well clued in and aware of AlertTemplates.xml and it's inner workings. If you are not, there are two great articles worth reading on Microsoft SharePoint Developer Documentation Team blog:

Customizing Alert Notifications and Alert Templates in Windows SharePoint Services 3.0

How To: Customizing alert emails using IAlertNotifyHandler

There is also a whitepaper from All MindsharpBlogs that is worth reading:

Modify Alert Notifications using AlertTemplates.xml in SharePoint 2007

So what other notifications would you need to customise I wondered? Well how about emails sent from SharePoint to notify a user when permissions are granted or modified on a list item, document, list or document library (see figure 1 below):

custom_email

Figure 1: Email notification from SharePoint

Where can we customise the text and links circled in red? I did a deep dive on this and my conclusion unfortunately is not a good one. You can't!

I opened up AcIinv.aspx (Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS). Aclinv.aspx is a page used in SharePoint to grant permissions to a user and generates the email as depicted in figure 1.

aclinv

Figure 2: Aclinv.aspx (Add Users)

Within Aclinv.aspx I found the following:

<%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> <%@ Page Language="C#" Inherits="Microsoft.SharePoint.ApplicationPages.AclInv" ......%>

This helped me to snoop into the assembly and identify the method SendEmailInvitation(PeopleEditor picker, string subject, string message) which is used to send the email. It also confirmed that it was not possible to modify the text or links circled in Figure 1 but only the email body text.

I hope this helps you in some way. BTW: If you wish to pre-populate the Personal Message in Aclinv.aspx this can be achieved by simply modifying the JavaScript function UpdateEmailSubject() .... it's nice to end a blog on a positive note :)

Comments

  • Anonymous
    April 30, 2008
    ...very disappointing. This is the one thing that I want to change!I guess you could create your own function to send a welcome email and edit Aclinv.aspx to call it instead, but that seems like a huge amount of effort just to change the wording of an email (and I wonder if that sort of change is supported in any case).
  • Anonymous
    July 28, 2008
    If anyone can provide a little guidance on how to pre-populate the Personal Message as mentioned in the last paragraph, I would greatly appreciate it.  I am no where near being a developer, but with a little more of a nudge I could probably figure it out.
  • Anonymous
    January 21, 2010
    First 2 links are good! Third link has no related info to email templates and the fourth link is broken!
  • Anonymous
    December 11, 2010
    spdactivities.codeplex.comThese add-ins will allow you to change the "FROM" and control many other portions during a workflow. Very handy.