unsubscribe users from mailing lists(email campaigns)

Posted by Community Admin on 04-Aug-2018 15:09

unsubscribe users from mailing lists(email campaigns)

All Replies

Posted by Community Admin on 02-Oct-2014 00:00

Hello All,

Sitefinity's default unsubscribe link is not visible in the emails that I send out. I tried to find a solution online but could not find anything. So, I decided to implement my own logic of unsubscribing users from mailing lists. I implemented it tested it, all works fine.

Consider the following scenario:

 1)I create a new mailing list

2)I import subscribers from a csv file to the mailing list. let us assume csv contains 10 records and the email of one of them is abc@xyz.com

3)I create a campaign and send out an issue with my unsubscribe link in the email. 

4) user abc@xyz.com gets the email, decides to unsubscribe. So, clicks on unsubscribe link and so he is removed from the mailing list.

5) Now I go back to the mailing list, and reimport the csv list. the user abc@xyz.com gets back on the mailing list and gets all emails again going forward.

Is there some way to keep the user and flag him as unsubscribed? I can maintain a separate list of unsubscribed users and which mailing list they unsubscribed from, but when the import happens, how do I exclude the users who unsubscribed already?

PS: I am using Sitefinity 6.3



Posted by Community Admin on 07-Oct-2014 00:00

Hello Phani,

As you have a custom code to unsubscribe the users, you can implement a logic to manage separate list for that unsubscribed users.

Than on User import you can add your logic once the users are imported to remove the already unsubscribed ones. To do so:
- Inherit the ImportSubscribers dialog:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Sitefinity.Modules.Newsletters.Web.UI.Forms;
namespace SitefinityWebApp.Examples
    public class MyImport : ImportSubscribers
        protected override void ImportSubscribersButton_Click(object sender, EventArgs e)
            base.ImportSubscribersButton_Click(sender, e);
            // implement your logic for the already unsubscribed users
- Register this control in Global.asax:
protected void Application_Start(object sender, EventArgs e)
    Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
private void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
    if (e.CommandName == "Bootstrapped")
        ObjectFactory.Container.RegisterType(typeof(DialogBase), typeof(MyImport), (typeof(ImportSubscribers)).Name);
Note that you need to have the following using
using Telerik.Microsoft.Practices.Unity;

Svetoslav Manchev
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