SharePoint: Custom alert template for a specific list view

2.4k Views Asked by At

Is it possible to use a different alert template for a specific list view?

An example... My list sends alerts using the default OOTB "SPAlertTemplate.GenericList" template whenever new items are added to it. However I want to instead use a custom email template whenever items are added that appear in the High Risk Incidents view.

I know how to create custom alert templates and associate them with a specific list -- just not how to associate them with a specific view of a list.

1

There are 1 best solutions below

0
On

According to the Alert template documentation you can use CAML in the FilterDefinition property to control what items are shown.

I don't believe you can point it at a view directly, but you could use the same conditions in your view in the FilterDefinition.

So if your view was made up of the condition RiskLevel=1 then you could use something like the following:

<FilterDefinition>
  <FriendlyName>CustomFilter1</FriendlyName>
  <ShortName>CustomFilter1</ShortName>
  <Query>  
    <Eq>
      <FieldRef name="RiskLevel"/>
      <Value Type='Text'>1</Value>
    </Eq>
</Query>

Some of these links may help:

Alert Template Format - http://msdn.microsoft.com/en-us/library/bb802961(v=office.12).aspx

Intro on CAML Query - http://sharepointmagazine.net/articles/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list