SharePoint – Change default setting of “Send an email invitation”


Hello everyone,

today I want to show you how you can change the default setting of the option “Send an email invitation”. The goal we are aiming for is to give our users a true choice to actively choose to send email invitations or not.

To achieve this we need to edit the AclInv.aspx file on all your SharePoint servers. I recommend to make a backup of the file and save it as something like AclInv.aspx.backup so you can easily revert back to the default settings if you do not like the changes. The changes we will make do not require a reboot of the servers.

SharePoint 2010

This is your default dialog on SharePoint 2010:

To change the default dialog open the AclInv.aspx file located here C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\AclInv.aspx. Now search for chkSendEmail and change Checked=True to Checked=False.

<wssawc:InputFormCheckBox runat="server" id="chkSendEmail" Checked="True" LabelText="<%$Resources:wss,aclver_SendEmailCheckbox%>" ToggleChildren=true>
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclver_SubjectLabel%>" EncodeMethod='HtmlEncode'/>
<wssawc:InputFormTextBox title="<%$Resources:wss,aclver_SubjectTitle%>" class="ms-long" ID="txtEmailSubject" Columns="35" Runat="server" MaxLength=512 OnChange="OnSubjectChanged()" />
<wssawc:InputFormRequiredFieldValidator id="ReqValEmailSubject" runat="server" BreakBefore=true BreakAfter=true EnableClientScript ="false" ControlToValidate="txtEmailSubject"/>
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclver_BodyLabel%>" EncodeMethod='HtmlEncode'/>
<wssawc:InputFormTextBox title="<%$Resources:wss,aclver_BodyTitle%>" class="ms-long" ID="txtEmailBody" Runat="server" TextMode="MultiLine" Columns="40" Rows="8" Cols=64 MaxLength=2000 />
</wssawc:InputFormCheckBox>
<wssawc:InputFormCheckBox runat="server" id="chkSendEmail" Checked="False" LabelText="<%$Resources:wss,aclver_SendEmailCheckbox%>" ToggleChildren=true>
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclver_SubjectLabel%>" EncodeMethod='HtmlEncode'/>
<wssawc:InputFormTextBox title="<%$Resources:wss,aclver_SubjectTitle%>" class="ms-long" ID="txtEmailSubject" Columns="35" Runat="server" MaxLength=512 OnChange="OnSubjectChanged()" />
<wssawc:InputFormRequiredFieldValidator id="ReqValEmailSubject" runat="server" BreakBefore=true BreakAfter=true EnableClientScript ="false" ControlToValidate="txtEmailSubject"/>
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclver_BodyLabel%>" EncodeMethod='HtmlEncode'/>
<wssawc:InputFormTextBox title="<%$Resources:wss,aclver_BodyTitle%>" class="ms-long" ID="txtEmailBody" Runat="server" TextMode="MultiLine" Columns="40" Rows="8" Cols=64 MaxLength=2000 />
</wssawc:InputFormCheckBox>

And after we have saved our changes your dialog will look like this:

That´s it. Your work is done.

SharePoint 2013

This is your default dialog on SharePoint 2013:

To change the default dialog open the AclInv.aspx file located here C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\AclInv.aspx. Now search for chkSendEmailv15 and change Checked=True to Checked=False.
Since I did not like the SHOW OPTIONS/HIDE OPTIONS link because I noticed that it confuses inexperienced users more than it is useful to them I commented out some code to remove it as you can see in the below code snippets.

...

function _spBodyOnLoad()
{
txtEmailBodyIsEmpty = InitializeGhostedElement((document.getElementById("<%= txtEmailBody.ClientID %>")), L_EmailBodyGhostedText, formLongInputGhosted, formLongInputNonGhosted, null);
UpdateAddToGroupOrRole();
UpdateWelcomeInheritMessage();
UpdateGivePermissionsHeading();
UpdateSendEmailMessage();
var groupRequiredValidator = (document.getElementById("<%= ReqValGroup.ClientID %>"));
var groupCustomValidator = (document.getElementById("<%= CusValGroup.ClientID %>"));
var txtEmailSubjectRequiredValidator = (document.getElementById("<%= ReqValEmailSubject.ClientID %>"));
if ((groupRequiredValidator != null) || (groupCustomValidator != null) || (txtEmailSubjectRequiredValidator != null))
{
var forceShow = true;
ShowHideMoreOptions(forceShow);
}
RenderSharingInformation();
SetInitialFocus();
}
 
...

<div class="ms-core-form-section">
<asp:PlaceHolder id="PanelShowHideMoreOptions" runat="server">
<wssuc:FoldHyperLink runat="server" LinkTitleWhenFoldClosed="<%$Resources:wss,aclinv_ShowOptions%>" LinkTitleWhenFoldOpened="<%$Resources:wss,aclinv_HideOptions%>" CustomClientClick = "ShowHideMoreOptions();" />
</asp:PlaceHolder>
</div>
<!-- More Options section is initially hidden; ShowHideMoreOptions controls the display of this div when link clicked -->
<div class="ms-core-form-section">
<div id="divMoreOptions" style="display:none;">
<asp:PlaceHolder id="PanelSendEmail" runat="server" visible="false">
<div class="ms-core-form-subsection">
<asp:CheckBox runat="server" id="chkSendEmailv15" Checked="true" class = "ms-aclinv-checkbox" OnClick="UpdateSendEmailMessage()"/>
<label for=<%SPHttpUtility.WriteAddQuote(SPHttpUtility.NoEncode(chkSendEmailv15.ClientID),this.Page);%>>
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclinv_SendEmailCheckboxv15%>" EncodeMethod='HtmlEncode'/>
</label>
<div id="divSendEmailOptions" style="display:none";>
<div class="ms-aclInv-emailOptions-heading"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclver_SubjectLabelv15%>" EncodeMethod='HtmlEncode'/></div>
<wssawc:InputFormTextBox title="<%$Resources:wss,aclver_SubjectTitle%>" CssClass="ms-fullWidth" ID="txtEmailSubject" Columns="35" Runat="server" MaxLength=512 OnChange="OnSubjectChanged()" />
<wssawc:InputFormRequiredFieldValidator id="ReqValEmailSubject" runat="server" CssClass="ms-error" BreakBefore="false" EnableClientScript ="false" ControlToValidate="txtEmailSubject"/>
</div>
</div>

...
...

function _spBodyOnLoad()
{
txtEmailBodyIsEmpty = InitializeGhostedElement((document.getElementById("<%= txtEmailBody.ClientID %>")), L_EmailBodyGhostedText, formLongInputGhosted, formLongInputNonGhosted, null);
UpdateAddToGroupOrRole();
UpdateWelcomeInheritMessage();
UpdateGivePermissionsHeading();
UpdateSendEmailMessage();
var groupRequiredValidator = (document.getElementById("<%= ReqValGroup.ClientID %>"));
var groupCustomValidator = (document.getElementById("<%= CusValGroup.ClientID %>"));
var txtEmailSubjectRequiredValidator = (document.getElementById("<%= ReqValEmailSubject.ClientID %>"));
/* if ((groupRequiredValidator != null) || (groupCustomValidator != null) || (txtEmailSubjectRequiredValidator != null)) */
/* { */
var forceShow = true;
ShowHideMoreOptions(forceShow);
/* } */
RenderSharingInformation();
SetInitialFocus();
}

...

<!-- <div class="ms-core-form-section">
<asp:PlaceHolder id="PanelShowHideMoreOptions" runat="server">
<wssuc:FoldHyperLink runat="server" LinkTitleWhenFoldClosed="<%$Resources:wss,aclinv_ShowOptions%>" LinkTitleWhenFoldOpened="<%$Resources:wss,aclinv_HideOptions%>" CustomClientClick = "ShowHideMoreOptions();" />
</asp:PlaceHolder>
</div> -->
<!-- More Options section is initially hidden; ShowHideMoreOptions controls the display of this div when link clicked -->
<div class="ms-core-form-section">
<div id="divMoreOptions" style="display:none;">
<asp:PlaceHolder id="PanelSendEmail" runat="server" visible="false">
<div class="ms-core-form-subsection">
<asp:CheckBox runat="server" id="chkSendEmailv15" Checked="false" class = "ms-aclinv-checkbox" OnClick="UpdateSendEmailMessage()"/>
<label for=<%SPHttpUtility.WriteAddQuote(SPHttpUtility.NoEncode(chkSendEmailv15.ClientID),this.Page);%>>
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclinv_SendEmailCheckboxv15%>" EncodeMethod='HtmlEncode'/>
</label>
<div id="divSendEmailOptions" style="display:none";>
<div class="ms-aclInv-emailOptions-heading"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclver_SubjectLabelv15%>" EncodeMethod='HtmlEncode'/></div>
<wssawc:InputFormTextBox title="<%$Resources:wss,aclver_SubjectTitle%>" CssClass="ms-fullWidth" ID="txtEmailSubject" Columns="35" Runat="server" MaxLength=512 OnChange="OnSubjectChanged()" />
<wssawc:InputFormRequiredFieldValidator id="ReqValEmailSubject" runat="server" CssClass="ms-error" BreakBefore="false" EnableClientScript ="false" ControlToValidate="txtEmailSubject"/>
</div>
</div>

...

And after we have saved our changes your dialog will look like this:

That´s it. Your work is done.

SharePoint 2016

This is your default dialog on SharePoint 2016:

To change the default dialog open the AclInv.aspx file located here C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\TEMPLATE\LAYOUTS\AclInv.aspx. Now search for chkSendEmailv15 and change Checked=True to Checked=False.
Since I did not like the SHOW OPTIONS/HIDE OPTIONS link because I noticed that it confuses inexperienced users more than it is useful to them I commented out some code to remove it as you can see in the below code snippets.

...
 
function _spBodyOnLoad()
{
txtEmailBodyIsEmpty = InitializeGhostedElement((document.getElementById("<%= txtEmailBody.ClientID %>")), L_EmailBodyGhostedText, formLongInputGhosted, formLongInputNonGhosted, null);
UpdateAddToGroupOrRole();
UpdateWelcomeInheritMessage();
UpdateGivePermissionsHeading();
UpdateSendEmailMessage();
var groupRequiredValidator = (document.getElementById("<%= ReqValGroup.ClientID %>"));
var groupCustomValidator = (document.getElementById("<%= CusValGroup.ClientID %>"));
var txtEmailSubjectRequiredValidator = (document.getElementById("<%= ReqValEmailSubject.ClientID %>"));
if ((groupRequiredValidator != null) || (groupCustomValidator != null) || (txtEmailSubjectRequiredValidator != null))
{
var forceShow = true;
ShowHideMoreOptions(forceShow);
}
RenderSharingInformation();
SetInitialFocus();
}

...

<div class="ms-core-form-section ms-aclinv-show-hide-options">
<asp:PlaceHolder id="PanelShowHideMoreOptions" runat="server">
<wssuc:FoldHyperLink runat="server" LinkTitleWhenFoldClosed="<%$Resources:wss,aclinv_ShowOptions%>" LinkTitleWhenFoldOpened="<%$Resources:wss,aclinv_HideOptions%>" CustomClientClick = "ShowHideMoreOptions();" />
</asp:PlaceHolder>
</div>

...
 
<asp:CheckBox runat="server" id="chkSendEmailv15" Checked="true" class = "ms-aclinv-checkbox" OnClick="UpdateSendEmailMessage()"/>

...
...
 
function _spBodyOnLoad()
{
txtEmailBodyIsEmpty = InitializeGhostedElement((document.getElementById("<%= txtEmailBody.ClientID %>")), L_EmailBodyGhostedText, formLongInputGhosted, formLongInputNonGhosted, null);
UpdateAddToGroupOrRole();
UpdateWelcomeInheritMessage();
UpdateGivePermissionsHeading();
UpdateSendEmailMessage();
var groupRequiredValidator = (document.getElementById("<%= ReqValGroup.ClientID %>"));
var groupCustomValidator = (document.getElementById("<%= CusValGroup.ClientID %>"));
var txtEmailSubjectRequiredValidator = (document.getElementById("<%= ReqValEmailSubject.ClientID %>"));
/* if ((groupRequiredValidator != null) || (groupCustomValidator != null) || (txtEmailSubjectRequiredValidator != null)) */
/* { */
var forceShow = true;
ShowHideMoreOptions(forceShow);
/* } */
RenderSharingInformation();
SetInitialFocus();
}
 
...
 
<!-- <div class="ms-core-form-section ms-aclinv-show-hide-options">
<asp:PlaceHolder id="PanelShowHideMoreOptions" runat="server">
<wssuc:FoldHyperLink runat="server" LinkTitleWhenFoldClosed="<%$Resources:wss,aclinv_ShowOptions%>" LinkTitleWhenFoldOpened="<%$Resources:wss,aclinv_HideOptions%>" CustomClientClick = "ShowHideMoreOptions();" />
</asp:PlaceHolder>
</div> -->

...
 
<asp:CheckBox runat="server" id="chkSendEmailv15" Checked="false" class = "ms-aclinv-checkbox" OnClick="UpdateSendEmailMessage()"/>

...

And after we have saved our changes your dialog will look like this:

That´s it. Your work is done.

I hope you liked my post and I hope to see you again next time 🙂

Sources:

http://jurisinnenad.blogspot.co.at/2016/09/disable-default-send-email-invitation.html

http://sharepointcherie.blogspot.co.at/2013/09/sharepoint-2013-disable-default-on-e.html

Advertisements
Tagged

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: