The UnsubscribeLinkData does not contain any information on which list that was used, since in theory a recipient could be represented in more than one list. When that happens we can't say which of the two (or more) lists was the source.
The solution would be to create a custom landing page where you list all the mailing lists and let the recipient choose which one to unsubscribe from, like a "your email preferences"-page.
You could use the GetSubscriptionsFor() method to list the existing subscriptions for a recipient, could also use the GetMailingListsForAllWorkspaces() to list all mailing lists if you need to.
Then based on the selections from the recipient you can use AddOrUpdateSubscriptions() to store the information.
You're right, the import feature will not overwrite anything at the moment it would be hard for us to know why something has changed. It could, in theory, also be the other way around, that the data stored in the "our" database is newer than the imported data. It could also be a combination, so the default behavior is to leave things alone if the email already exists.
You can always use the API to sync data if you need to keep things in sync over time.
If you just imported them you could remove them using a SQL script and then add them back again, or you could update the data to the database via some kind of script.
At the moment there is no built-in way to perform the task that you're looking to solve - sorry.
Unsubscribe from only one mailing list
Hello
How can you be unsubscribed from only one e-mail list and not from all of them?
We have a controller where we ParseUnsubscribeToken(token).
Should we do it with the AddOrUpdateSubscriptionsRequest --> unsubscribe?
if yes from where could I grab the RecipientId, MailingListId params from the token?
thanks for your help.
Hi!
The
UnsubscribeLinkData
does not contain any information on which list that was used, since in theory a recipient could be represented in more than one list. When that happens we can't say which of the two (or more) lists was the source.The solution would be to create a custom landing page where you list all the mailing lists and let the recipient choose which one to unsubscribe from, like a "your email preferences"-page.
You could use the
GetSubscriptionsFor()
method to list the existing subscriptions for a recipient, could also use theGetMailingListsForAllWorkspaces()
to list all mailing lists if you need to.Then based on the selections from the recipient you can use
AddOrUpdateSubscriptions()
to store the information.There should be some examples in the docs: https://www.newsletterstudio.org/documentation/package/13.0.0/develop/front-end-api/
Feel free to ask if you need further assistance.
Cheers!
Hi
Perfect thanks for your feedback.
another question regarding the import of contacts. if a contact already exists but a field is changed, for example last name, this is ignored...
is it possible to overwrite this from the import?
Hi!
You're right, the import feature will not overwrite anything at the moment it would be hard for us to know why something has changed. It could, in theory, also be the other way around, that the data stored in the "our" database is newer than the imported data. It could also be a combination, so the default behavior is to leave things alone if the email already exists.
You can always use the API to sync data if you need to keep things in sync over time.
Hope this make sense,
Cheers!
// Markus
Ok yes that's what I thought. maybe you could make a checkbox at import where data can be updated :).
I forgot to map a field and can't update the contacts afterwards in a easy way.
Hi!
I understand the problem,
If you just imported them you could remove them using a SQL script and then add them back again, or you could update the data to the database via some kind of script.
At the moment there is no built-in way to perform the task that you're looking to solve - sorry.
// Markus
is working on a reply...