Welcome to Office & SharePoint Pro Sign in | Join | Help
in Search

SUBSCRIBE to Windows IT Pro Magazine & SAVE 30%      Register today for your FREE "SharePointPro Connections UPDATE " eNewsletter

custom email body when adding new user in Sharepoint 2007 forms authentication

Last post 02-25-2008, 3:27 PM by Sundher. 0 replies.
Sort Posts: Previous Next
  •  02-25-2008, 3:27 PM 29323

    custom email body when adding new user in Sharepoint 2007 forms authentication

    Often developers find the requirement from the clients on the email message body that sharepoint sends out when a user is added to the site. It looks like the following,

     

    Welcome to the SharePoint site at: http://sharepointsite. System Account (domain\username) has granted you access to this site with the following permissions: Permission set.

     Clients do not need that message or they want to customize it. It is pretty easy to implement that.

    Check the aclinv.aspx  file in the _layouts folder,  modify the following two sections of the file to send out custom email message..

     Method 1:

     

    under the declarations sections modify the page declaration tag

    actual tag: 

    <%
    @ Page Language="C#" Inherits="Microsoft.SharePoint.ApplicationPages.AclInv" MasterPageFile="~/_layouts/application.master" %>

     Replace inherits with your own class with two methods,

    1. PageTitleUrl()

    2. BtnOK_Click()

    Method 2:

    Else if you leave the Inherits to blank value, and write those two methods as part of the same page.

    Here is the simple Implementation for  BtnOK_Click()

    private void AddUser(Object sender , EventArgs args)

    {

    SPUtility.SendEmail(SPContext.Current.Web, true, true, userPicker.

    CommaSeparatedAccounts

    , txtEmailSubject.Text, txtEmailBody.Text);

    Server.Transfer("/_layouts/user.aspx");

    }

     

View as RSS news feed in XML
SPONSORED LINKS FEATURED LINKS

SharePointPro 2010 Summit & Expo, Mar. 16-19 in Las VegasDetails on SharePoint 2010, in-depth technical training and more! Ten Things to Look for in a SharePoint Recovery ToolSee how third-party tools can offer the power to quickly and easily restore critical SharePoint data. F5 and HP Partner to Optimize SharePoint Server 2007If you are, or will be, assisting in deploying Office SharePoint Server 2007 solutions accessed over a Wide Area Network (WAN), you'll find this podcast of value Storage Optimization for SharePointThis Technical Advisor will put you on the path toward optimizing storage for SharePoint. How to Get a Highly Available Virtualized SharePointHow the F5 BIG-IP Local Traffic Manager (LTM), Microsoft SharePoint Server, and Windows Server Hyper-V can work together to improve application performance, deliver a better user experience, and use your resources more efficiently in a virtualized environ