Software Support Forum


Research answers to your questions, or request support for SharePoint
Solutions software products. Our forums are grouped by software product.
Welcome to Software Support Forum Sign in | Join | Help
in Search

Subscribe to a custom alert template from a workflow

Last post 11-13-2008 2:44 PM by davidfisher. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-12-2008 12:51 PM

    Subscribe to a custom alert template from a workflow

    Is it possible to create an Alert Template and then during a workflow when I subscribe a user to the alert set the template?

    SPAlert spAlert = spWeb.Alerts.Add();
    spAlert.AlertType = SPAlertType.List;
    spAlert.AlertFrequency = SPAlertFrequency.Immediate;
    spAlert.EventType = SPEventType.All;
    spAlert.List = spList;
    spAlert.User = spUser;
    spAlert.Update();

    What would I specify to select my custom template?

     Thanks

    Wes

  • 11-13-2008 2:44 PM In reply to

    Re: Subscribe to a custom alert template from a workflow

    Once you create an alert template, you should be able to retrieve it and set it for the SPAlert object. Use the Microsoft.SharePoint.SPAlertTemplateCollection(SPWebService wssService) constructor to return the list of SPAlertTemplates for the web application, then get an instance of the one you are looking for and set the SPAlert.AlertTemplate property to the SPAlertTemplate.

    David Fisher
    Software Engineer
    SharePoint Solutions
Page 1 of 1 (2 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems