Reputation: 11
I'm trying to set up alerts to go to the item creator whenever the item is edited. Can anyone point me in the right direction.
Upvotes: 1
Views: 3671
Reputation: 10335
Create an Event Receiver that handles ItemAdded. Use the following code to get the author of the item:
SPWeb web = properties.Web;
SPListItem item = properties.ListItem;
SPFieldUserValue userValue =
new SPFieldUserValue(web, item[SPBuiltInFieldId.Author].ToString());
SPUser user = userValue.User;
You can then add a new SPAlert to the user for the current item.
Upvotes: 0