Uncheck "Send email notification for responses to"

Posted by Community Admin on 04-Aug-2018 20:24

Uncheck "Send email notification for responses to" setting

All Replies

Posted by Community Admin on 03-Mar-2016 00:00

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

Posted by Community Admin on 24-Mar-2016 00:00

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: screencast.com/.../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
 

This thread is closed