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

SUBSCRIBE to Windows IT Pro Magazine & SAVE 30%      FREE Email Newsletters Vista UPDATE, Windows IT Pro UPDATE & More

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

SharePoint Security SimplifiediDevFactory announces that SWAT 2007® is now FREE! Order Your Fundamentals CD Today!Get up to speed quickly and learn how to uncover rich information management and deployment capabilities with this free SharePoint CD. Maximize Your SharePoint Investment: Get Your Data MovingJoin us as we take a look at the complex business of securing, accessing and managing vast amounts of information in a global network and various ways to get your data moving. SharePoint Connections event returns to Las Vegas Nov 10 - 13Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. It is co-located with Microsoft ASP.NET, SQL Server and Windows Connections with over 250 in-depth sessions. Ease Your Scripting Pains with the Flexibility of PowerShell!Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!