When someone clicks on the unsubscribe all button, a modal will appear asking them to confirm their selection. If the user clicks on the modal button to confirm that they want to unsubscribe from everything, we call the
unsubscribeAllNewsletters()
function.
That function will close the modal out, then loop through the PreferenceCenterData.JourneyPublicationLists and PreferenceCenterData.DataExtensions objects. If the publication has a subscribed value of true, we then call the infividual
unsubscribeFromPublication()
function, passing the DE/Publication list name.
This creates a new AJAX request where we pass the following values as a query string to our generic post_url (which would be the page at MicrositeURL(5456))
subscription_line = Data Extension Name or Publication List name passed into the function
subscribed = false
action = updateSub