Archive > Preference Center > Publication Lists

Table of Contents

Data Management Admin Tool

Use the data management tool to manage subscribers with publication lists.

Access to the Flying Cork x UPMC back end data management tool is currently granted via email.

Manage Publication Lists

Visit the data management tool (via the access URL provided in an email) and navigate to Manage Newsletters and Categories > Publication Lists.

The file below creates the functionality to add, edit, delete, and display publication lists within the back end data management tool. Data manually populated into the back end then gets pulled into the front end of the UPMC Dynamic Preference Center.

The data from this section gets recorded in a data extension called Available_Publication, located here:

Shared Items > Shared Data Extensions > Preferences_Dynamic > Available_Publication.
Add Publication List

Click “Add New Publication List” to add a new publication list. These additions will immediately be reflected in the preference center.

Edit/Delete Publication List

Click the “Edit” button to the right of the publication list to make changes to that particular publication list.
When publication list data is edited using the data management tool, the record in the Available_Publication data extension will also be updated, and changes are immediately reflected in the preference center…if applicable.

Click the “Delete” button to the right of the publication list to delete it. 
When publication list data is deleted using the data management tool, the record in the Available_Publication data extension will also be deleted, and the publication list will no longer be available in the preference center…if applicable.

Preference Center Interface

On Page Load
When the page loads, we pull records from the Available_Publication Data Extension. Then we start to loop through the records returned by the DE and add them into our PreferenceCenterData.PublicationLists Object.

The Available_Subscriptions DE can also contain publication lists. We can also process these records and check the data_extension_name field in for “PublicationList” using IndexOf. Then if a match is found, we run a lookup on that publication list using the visitor’s stored email address to see if they’re subscribed.
Initialize/Populate Subscriptions
We then alphabatize the newsletters with
sortByTitle()
. Once the newsletters are sorted, we call the
initializeSubscriptions()
function, and we loop through the de_title_pairs object to populate the page with the newsletters’ DOM objects
Filtering Newsletters

We run the filterNewsletters() function onChange, which will:

  • Create a new array, called divsToHide, containing all of the newsletter DOM objects
  • Grab the value (which would be the category) from the dropdown
  • Set all newsletters to display none, then loop back through the divsToHide array and set any newsletters matching the category pulled from the dropdown to display inline block.

 

Checking Publication List from Journey Email (Showing a Journey in the First Position)

We only want to show a visitor the journey publication when they come from an email in that journey; and we want to make sure that journey appears first under My Subscriptions.



Once someone visits the preference center, we check the query string for “data_extension_name” and “publication_list_id“. If one is found, we pull that value and set @first_position_de. (Note: All journeys use publication lists and NOT data extensions. This is due to limitations of removing users from data extensions and how SFMC processes journeys.)



If the field “publication_list_id” is detected, we prefix the ID that we pull with “PublicationList_”, which should give us something like PublicationList_1234. Then we use that value to set the @first_position_de variable.


Then we loop through DynamicPreferenceCenterData and populate the visitor’s current subscriptions with the

AddToMySubscriptions()

function. For every deName passed into that function, we compare it against the @first_postion_de variable. If it matches, we build the HTML for the subscription like we’d normally do, but inside of the div with the ID of “my-first-position“, which is located before all other subscriptions in that list and ensuring that it’s the first item seen under the My Subscriptions section.

Relevant Functions
sortByTitle(array)
We have to use a bubble sort to alphabatize all the data extensions and publication lists because Internet Explorer doesn’t allow us to make use of the .sort() function.

initializeSubscriptions()
This is the core function that populates the page on load. We use the
sortByTitle()


function to alphabatize the array of objects, de_title_pairs. Once sorted we loop through the array and call the
AddToMySubscriptions()
,
AddToFeaturedSubscriptions()
, and
AddToAllSubscriptions()
functions passing the DE name / publication list ID

AddToAllSubscriptions(deName)
Creates a DOM object in the All Subscriptions section and adds an event listener to the toggle switch. If the current deName passed into the function matches the first_position_de it will add a DOM object in the all-first-position div.

AddToMySubscriptions(deName)
Creates a DOM object in the My Subscriptions section and adds an event listener to the toggle switch. If the current deName passed into the function matches the first_position_de it will add a DOM object in the my-first-position div.

The data extension name is passed in as deName and we use that to look up the title, description, image url, etc. in the PreferenceCenterData.DataExtensions object.

AddToFeaturedSubscriptions(deName)
Creates a DOM object in the Featured Subscriptions section and adds an event listener to the toggle switch.

The data extension name is passed in as deName and we use that to look up the title, description, image url, etc. in the PreferenceCenterData.DataExtensions object.

Preference Center Data Processing

When subscribing, the parameters are action = updateSub, subscribed != false, and PublicationList + the ListID. It will make the email in that list have a status of “Active”

When unsubscribing, the parameters are action = updateSub, subscribed = false, and PublicationList + the ListID. It will make the email in that list have a status of “Unsubscribed”

Use the data management tool to add, edit, and delete all available UPMC newsletters.

Access to the Flying Cork x UPMC back end data management tool is currently granted via email.

Your email address will not be published. Required fields are marked *