Maileon Unsubscription Pages
Maileon Provided Landing Pages
The standard Maileon unsubscription page is a single landing that is displayed after a contact has been succesfully unsubscribed.
Standard Unsubscription Landing
There is an advanced version of this page that lets the user specify the reason for unsubscribing before they are removed from the system.
Unsubscription Landing with Reasons
The default functionality of unsubscription landing can be specified in the settings part of the UI. The option is available at Settings/Pages/Basic Settings.
Unsubscription landing page settings
The default option (forward to stored page at Page Management) only forwards the user to a static page after unsubscribing them from the system. The default message is only shown if there is no page specified here.
The advanced landing is available by selecting the Detection of unsubscribe reasons option. The preview of this page can also be seen by clicking the Standard form link.
Custom unsubscription landing pages
It is also possible to implement unsubscription landing pages using the Maileon API. This can be achieved by using a personalized link in mailings instead of the default unsubscription link.
This personalized link should contain some data with which the user can be identified in the Maileon system. For example a link with an email personalization can be used to unsubscribe users by email address:
http://mysite.example.com/newsletter-unsubscribe?email=[CONTACT|email]
The link above will be sent to each user with their own email address (e.g.: http://mysite.example.com/newsletter-unsubscribe?email=balog.viktor%40maileon.hu)
After changing the unsubscription link to one like the above custom logic can be implemented on the receiving landing page.
Sticking with this example a call to the API endpoint Unsubscribe Contacts By Email can be used to unsubscribe a contact from Maileon and record the reson for the unsubscription.
Sample PHP code
The following code utilizes the Maileon PHP API client which is available here.
$contactsService = new com_maileon_api_contacts_ContactsService(array( 'API_KEY' => '', // the API key acquired from Maileon/Settings/API keys 'BASE_URI' => 'https://api.maileon.com/1.0' )); $mailingId = ''; // optionally a Maileon mailing ID can be provided to attach this unsubscription to a specific mailing; this should be also added to the link above as required, e.g.: &mailingId=[MAILING|ID] $reasons = array( 'too_many_messages|my custom text' ); /** @see http://dev.maileon.com/api/rest-api-1-0/contacts/unsubscribe-contacts-by-email/ for all possible reasons*/ $response = $contactsService->unsubscribeContactByEmail($_GET['email'], $mailingId, $reasons); if ($response->isSuccess()) { echo "<h1>Succesfully unsubscription</h1>"; }