# Subscribe to published comments submitted for news items

The Sitefinity CMS API enables you to configure email subscription for comments published for all new items.

> info **PREREQUISITES**:
> Setup the email notifications. For more information, see [Administration: Configure notification profiles](https://www.progress.com/documentation/sitefinity-cms/administration-configure-notification-profiles).

First, you must enable email subscription in Sitefinity's backend. Next, you configure your email subscription settings.

1. In Sitefinity's backend, navigate to *Administration* » *Settings* » *Advanced* » *CommentsModule* » *Commentable types* » *Telerik.Sitefinity.News.Model.NewsItem*.
2. Select the *Enable email subscription* checkbox.
3. In Visual Studio, open your Sitefinity CMS project.
4. If you do not have a `Global.asax` file, create a new `Global.asax` file added to your project. In the context menu of your project, click *Add* » *New Item…* » *Visual C#* » *Web* » *Global Application Class*.
5. To configure email subscription, copy and paste the following code in the Sitefinity `Bootstrapper.Bootstrapped` event that you cna subscribe to in your `Global.asax` file:

   ```C#
   // SF_11.0 - https://docs.sitefinity.com/subscribe-to-published-comments-submitted-for-news-items
   // https://gist.github.com/b3b66ffbefaeb46c4a87cb908ca6514b
   using System;
   using System.Web;
   using Telerik.Sitefinity.Abstractions;
   using Telerik.Sitefinity.Data;
   using Telerik.Sitefinity.News.Model;
   using Telerik.Sitefinity.Services;
   using Telerik.Sitefinity.Services.Comments.Notifications;

   namespace SitefinityWebApp
   {
       public class Global : HttpApplication
       {
           protected void Application_Start(object sender, EventArgs e)
           {
               Bootstrapper.Bootstrapped += Bootstrapper_Bootstrapped;
           }

           private void Bootstrapper_Bootstrapped(object sender, EventArgs e)
           {
               var commentService = SystemManager.GetCommentsService();

               commentService.Subscribe(new SubscriptionData()
               {
                   SubscriberEmail = "subscriberEmail",
                   ThreadType = typeof(NewsItem).FullName
               });
           }
       }
   }
   ```

   > info  **NOTE**: Make sure enter a valid value for the `subscriberEmail` variable.

The `CommentService` exposes the `Subscribe` method with `SubscriptionData` as an argument where you can specify the type of comment thread. The comment thread type can be any string.

After you configure email subscription, an email is sent to the specified email address every time a comment is published on any news item in Sitefinity.

You can optionally subscribe to comments that reflect your custom criteria. To do this:

1. Drag and drop a *Comments* widget on a page.
2. In the widget's *Edit* mode, click *Advanced*.
3. In the\`\`*ThreadType* field, enter a name, for example *MyCustomType*.

As a result, every comment published in this *Comments* widget triggers email notifications for threads of type *MyCustomType*.
