Table of Contents:

Configurable Email Preference Center

Ongage offers a fully configurable PHP & JavaScript email preference center package (made up of 4 files) that can be easily integrated into your PHP based website without any coding.

Technical Details 

Config.php

index.html

See inside commented section of this file for instructions and examples of how to implement check-boxes and radio buttons in this preference center form

                 /**
				 * Configure checkboxes fields
				 *
				 * Each key of the checkbox object must be real list-field name and it must contain an inner object with the following keys:
				 *
				 * The checkbox object assumes you saved some data in a format similar to this example: "value1,value2,value3" (notice the "," delimiter)
				 *
				 * delimiter - string - the delimiter you used in your contact's list field
				 * options   - object - with the following format: {value1: 'Title 1', value2: 'Title 2'}
				 *
				 * If contact's "checkbox" list-field value is not empty - The checkboxes that contains the contacts values will be checked
				 * In contact's "checkbox" list-field is empty           - Non of the checkboxes will be checked
				 *
				 *
				 * **********************************
				 * * Example of the expected format *
				 * **********************************
				 * (This example will output one form group with two checkboxes)
				 *
				 * checkboxes = {
				 * 	// Field name
				 * 	list_field_name: {
				 * 		// String delimiter
				 * 		delimiter: ',',
				 * 		// Checkbox options {value => label}
				 * 		options: {
				 * 			option_value_1: 'Option title 1',
				 * 			option_value_2: 'Option title 2'
				 * 		}
				 * 	}
				 * }
				 *
				 *
				 *
				 * @type {object}
				 *
				 */
				checkboxes = {},
				/**
				 * Configuring radio buttons
				 *
				 * Each key of the radio buttons object must be real list-field name
				 * The inner object must have the following format:
				 *
				 * {value: 'title'}
				 *
				 * In case user's list-field value is empty - non of the radio button will be marked
				 *
				 * **********************************
				 * * Example of the expected format *
				 * **********************************
				 * (This example will output 1 form group with 2 radio-buttons)
				 *
				 * radio_buttons = {
				 *	// Field name
				 *	list_field_name: {
				 *		// Radio buttons options
				 *		option_value_1: 'Option title 1',
				 *		option_value_2: 'Option title 2',
				 *	}
				 *}
				 *
				 * @type {object}
				 */
				radio_buttons = {};

How to Use This Preference Center as your Primary Unsubscribe Page

If you're using this preference center as your main email unsubscribe page, you'll need to do the following:

  1. Ask Ongage Support to disable the enforcing of the Ongage unsubscribe link in the body of your email message.
  2. Instead of using the Ongage unsubscribe link, you'll use a regular link in the body of your email message that will lead to this preference center page for unsubscribing.  
    1.  Note: in this case these links will get click counts, unlike Ongage unsubscribe links which don't count clicks. Having said that in the WYSIWYG editor, you can set this link to not count clicks.
  3. On this link pass the following parameters: {{email}}, {{ocx_list_id}} and {{ocx_child_id}} (in order to associate the unsubscribe to it's corresponding campaign).
  4.  In the server.php file, adjust the code to read the incoming URL parameter: {{ocx_child_id}}.
  5. In OngageConnect.php file pass {{ocx_child_id}} to the change_status API call.


(info) Alternatively, some customers choose to keep the Ongage unsubscribe link, and send in their emails two links:

  1. One link to the preference center with accompanying text about changing one's mailing preferences (e.g., mail topics, frequency, etc.)
  2. And a second smaller link at the bottom to unsubscribe from all mailings directly from the email.
    1. In that case, customers will typically also choose the "Add Unsubscribe Confirmation Page" in the Email Settings.
    2. And they might also choose the "Success Page Redirection" option – to anyway send the contact to the preference center, just in case they may want to resubscribe.