Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
Mart Muller wrote a great tip about creating alerts programatically:
In some cases you want a user to automatically create alerts on particular lists, for example an action list. It's very easy to achieve that:
SPWeb thisWeb = SPControl.GetContextWeb(Context);thisWeb.AllowUnsafeUpdates = true;SPList myList = thisWeb.Lists["ListName"];
// in this case a daily alert on all list actionsthisWeb.CurrentUser.Alerts.Add( myList,SPEventType.All,SPAlertFrequency.Daily);thisWeb.CurrentUser.Update();
The same way, alerts can be added for list items.