+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Uncheck "Send email notification for responses to" setting

Uncheck "Send email notification for responses to" setting

2 posts, 1 answered
  1. Yuan
    Yuan avatar
    3 posts
    Registered:
    15 Sep 2015
    03 Mar
    Link to this post

    Hello,

    Under the settings for a Sitefinity form, there are 2 checked boxes under the "Send email notification for responses to..." section. After checking the "List of email address.." and entering one email address, I am now unable to uncheck or remove the email from the settings any more.

    I am able to remove or add more email addresses to the list, but I cannot remove all of the emails.

    I have tried many combinations of settings to try to keep it unchecked. But when I go back to the settings, it's the same as before. 

    Thanks.

    =================
    Sitefinity Version: 8.2.5900.0

  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    26 Sep 2016
    24 Mar
    Link to this post
    Hello,

    This is a known issue which we have logged in our feedback portal on the following link:

    http://feedback.telerik.com/Project/153/Feedback/Details/185708-unable-to-uncheck-the-list-of-email-addresses-checkbox-in-form-edit-and-disable-n

    You can subscribe to receive notifications for the bug including new comments, votes, status changes by clicking on the "Follow this item" link. If you would like to unsubscribe, you can unfollow the item by removing "Following this item”.

    As a workaround, if users do not want to receive notifications on form submissions, they can unsubscribe themselves by clicking on the Actions link of specified form and then select Unsubscribe.

    Another approach is to unsubscribe the users using the API. Here is a sample code for your reference for unsubscribing users who have subscribed for form responses by passing the form name:



    using 
    System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Sitefinity.Forms.Model;
    using Telerik.Sitefinity.Modules.Forms;
    using Telerik.Sitefinity.Services;
    using Telerik.Sitefinity.Services.Notifications;
      
    namespace SitefinityWebApp
    {
        public partial class UnsubscribeFormSubscribers : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                // the name of your form under Content -> Forms -> <your form> -> form's Actions link -> Properties -> Name used in code (for developers) field
                string formName = "sf_testform";
      
                var formManager = FormsManager.GetManager();
                var form = formManager.GetForms().Where(f => f.Name == formName).SingleOrDefault();
      
                var subscriptionListId = form.SubscriptionListId;
      
                var notificationService = SystemManager.GetNotificationService();
                var serviceContext = new ServiceContext("ThisApplicationKey", formManager.ModuleName);
      
                List<ISubscriberResponse> formSubscribers = notificationService.GetSubscribers(serviceContext, subscriptionListId, newQueryParameters()).ToList();
      
                foreach (var subscriber in formSubscribers)
                {
                    notificationService.Unsubscribe(serviceContext, subscriptionListId, subscriber.Id);
                }           
            }
        }
    }

    In order to find the form name, you can go to Content -> Forms and click on the form's Actions link and then select Properties. The form name you need to use in the code above is displayed in the Name used in code (for developers) field. Please refer to the screenshot: http://screencast.com/t/hZ4x5jkPsR 

    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
    Answered
2 posts, 1 answered