Mautic handles them by setting “Do not contact” which stops all the communications.
But If I have multiple newsletters/segments - I just want to unsubscribe that consumer from just that one newsletter, not the entirety of mailings.
What I’ve tried as a workaround:
I’ve implemented my own unsubscribe page - and was hoping to simply override the List-Unsubscribe header so one-click unsubscribes go to my custom page and then my logic would simply remove them from just that one newsletter.
a) There is a bug(or a feature?) in custom headers code - which mangles (or sanitizes) urls - is that by design?:
b) But even if I can inject my own one click unsubscribe link - Mautic adds it’s own one click unsubscribe url no matter what (which still causes DNC mark) :
$listUnsubscribeHeader = $this->getUnsubscribeHeader();
if ($listUnsubscribeHeader) {
if (!empty($headers['List-Unsubscribe'])) {
if (!str_contains($headers['List-Unsubscribe'], $listUnsubscribeHeader)) {
// Ensure Mautic's is always part of this header
$headers['List-Unsubscribe'] = $listUnsubscribeHeader.','.$headers['List-Unsubscribe'];
}
} else {
$headers['List-Unsubscribe'] = $listUnsubscribeHeader;
}
$headers['List-Unsubscribe-Post'] = 'List-Unsubscribe=One-Click';
}
I’m not sure I understand the logic in always injecting mautic unsubscribe link, if I specifically intentionally configure my own List-Unsubscribe header ?
I can easily send a PR allowing full List-Unsubscribe overrides, ex:
if (!empty($headers['List-Unsubscribe'])) {
if (!str_contains($headers['List-Unsubscribe'], $listUnsubscribeHeader)) {
// Ensure Mautic's is always part of this header
$headers['List-Unsubscribe'] = $listUnsubscribeHeader.','.$headers['List-Unsubscribe'];
}
} else {
$headers['List-Unsubscribe'] = $listUnsubscribeHeader;
}
to this:
if (empty($headers['List-Unsubscribe'])) {
$headers['List-Unsubscribe'] = $listUnsubscribeHeader;
}
Hello,
Thank you for sharing this. It addresses a very real issue.
Would your solution unsubscribe the person based on segment membership? Remove the person from that segment?
Would your solution unsubscribe the person based on segment membership? Remove the person from that segment?
yes. I coded a wp plugin where unsubscribe link just takes a person to a wordpress site page which then removes them from a segment/segments and shows some “sorry to see you go message”. (using mautic api)
which is - it works fine as a link in the email. but then this “one click unsubscribe header” - also needs to be addressed for consistency.
But one click unsubscribe happens also programatically without page views.
Gmail shows the ‘Unsubscribe’ link at the top of the email, and fires the one click unsubscribe in the background - server to server.
A proper “ok 200” answer is needed here to be compliant.
Joey