Custom unsubscribe

Hi All,

Im trying to customise the unsubscribe to just unsubscribe from the the lists that were selected as part of the campaign/message. I also want this to be automatic (i.e. not get given a set of lists to select from ) Ive worked out the elements and pieces of code that carry out the unsubscribe in index.php. However I need to link the unsubcribe to the message…

To do this, I need to select the message id and associated lists from the database. I see two ways to do this.

  1. somehow pass the messageid into the mail, and add it to the link to unsubscribe, so it can be used in the unsubscribe PHP code, or alternateively,
  2. use the custom link/token supplied on the unsubscribe url to then find the message associated with it, select it, and remove users from the lists that relate to the campaign… I cannot seem to do either.

I can’t find a way to add the message ID into the page, and I look in all the tables in the database that might hold the individual token, and cannot find it (I assume its encrypted somehow)…

Please could someone advise how to do either of these…

Many Thanks

This request, being able to “unsubscribe” from a single list, the list that the campaign was sent to, has come up a few times. Trying to modify the phplist code in the way that you describe is going to be difficult.

I think that a better approach is to use a new placeholder, say CAMPAIGNREMOVEURL, and use that instead of the standard UNSUBSCRIBEURL. You can develop a plugin to replace that with a URL that includes the message id in addition to the subscriber uid.
The plugin would also need a page that handles someone clicking that link. The processing would be to find the lists that the campaign was sent to and remove the subscriber from those lists.

Yes indeed, phpList has quite a strong unsubscribe function as part of it’s “permission marketing” method. It’s quite key to how the software works (though we often discuss how to soften it a little)

Yes, or more simply just use a template which points people firmly at [PREFRENCESURL] and a really clear subscribe / unsubscribe page to people can opt in or out of lists as they please. Then your unsubscribeurl as a less obvious option in the footer etc. That way those who really want to get out can do, but those who just want to tweak their membership have the best chance :smile:

The happier your lists the better :smile:

is there a way to choose the strength of the unsubscribe function in a futur version by the administrator himself? So that the admin can choose in between (just an idea):
unsubscribe and user is blacklisted on all lists
unsubscribe and user is blacklisted for a single list
unsubscribe and user is removed from all lists
unsubscribe and user is removed from a single list

I would really like to use the PREFERENCEURL-way, but due to i18n System emails from PREFERENCEURL Page this is not possible in a multi-language setup (or I just was not able to figure out how it works :wink: ).

Best regards,


It’s more likely we can fix this than

  • there is no way to do this at the moment and it’s very core code too…

mmm, I agree, that needs fixing. There has been some focus on this recently, so now is a good time to report the feature. Ideally the “Message subscribers receive when they have changed their details” currently in config > settings should also have an override attached to the subscribe page, as it does with the confirm emails etc. Do you agree?

The “feature” is already there for subscription/unsubscription emails, so this schema just needs to be expanded to the “detail change” emails.

1 Like

Ok I will make a feature request :smile: