...
There is an advanced version of this page that lets the user specify the reason for unsusbcribing unsubscribing before they are removed from the system.
...
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 unsusbcribe unsubscribe users by email address:
http://mysite.example.com/newsletter-unsubscribe?email=[CONTACT|email]
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
$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>";
} |
...