# Custom Unsubscribe Page Does Not Work

**URL:** <https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222>\
**Category:** Product Support\
**Created:** [July 21, 2021, 2:24am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222 "2021-07-21T02:24:46Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![grafx77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/grafx77/32/636_2.png) [@grafx77](https://forum.mautic.org/u/grafx77)\
**Post date:** [July 21, 2021, 2:24am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/1 "2021-07-21T02:24:46Z")

</div>

**Your software**  
My Mautic version is: 3.3.3  
My PHP version is: 7.4

I can’t seem to be able to setup a custom unsubscribe page. It simply doesn’t work according to the instructions outlined on the Mautic documentation here: [Customize preference center | Mautic](https://docs.mautic.org/en/contacts/preference-center/customize-preference-center)

I’ve triple checked everything and am missing nothing. The unsubscribe link takes you to the default Mautic page with the line " We are sorry to see you go! [email@gmail.com](mailto:email@gmail.com) will no longer receive emails from us. If this was by mistake, click here to re-subscribe."

**These are the steps I have taken…**

- I setup the landing page and selected the “set preference center” for it. The gear icon is showing.
- Editing the welcome email, I have selected the correct “preference center page” called “Unsubscribe page” under the dropdown.
- My welcome email has the {unsubscribe\_link} token in it.

According to the documentation, this should work, but it does not. Am I missing something?

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [July 21, 2021, 6:43am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/2 "2021-07-21T06:43:13Z")

</div>

Many of us have the same issue, it’s a bug that has been reported on github.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 21, 2021, 6:59am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/3 "2021-07-21T06:59:36Z")

</div>

Did you guys try this? Does the bug still exists?

[![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a88ad78e3384569d0eebc516c47fc3ae86f7d52f.jpeg "Understand Unsubscribes And Create Awesome Preference Center With Friendly Automate (Mautic)") ](https://www.youtube.com/watch?v=JdgVdiv1JhU)

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [July 21, 2021, 7:15am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/4 "2021-07-21T07:15:26Z")

</div>

I followed your TUT a few weeks back and had the bug with 3.3.3 I have not tried recently but as there have not been any updates I expect the ug still exists.

I will try again and report back.

---

<div class="post-metadata">

**Author:** ![grafx77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/grafx77/32/636_2.png) [@grafx77](https://forum.mautic.org/u/grafx77)\
**Post date:** [July 21, 2021, 8:19am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/5 "2021-07-21T08:19:35Z")

</div>

> [@robm](#):
>
> Many of us have the same issue, it’s a bug that has been reported on github.

Ok great! I’m glad I’m not going crazy here. Really wish someone would update the documentation to reflect that this feature is not working. Would have saved me a ton of time.

@joeyk yeah it still doesn’t work. Updating the preference center under configuration is the only thing different you did opposed to the documentation, which I tried earlier.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 22, 2021, 7:55am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/6 "2021-07-22T07:55:25Z")

</div>

I just tested, and works for me on 3.3.2.  
Can you please point me at the github bug, so I can follow the instructions?  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/baecb80b92f3c1a7a179c31bc3fe2e2eec9ee4d5.png)

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [July 22, 2021, 8:00am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/7 "2021-07-22T08:00:46Z")

</div>

> <https://github.com/mautic/mautic/issues/9766>
>
> \[//\]: # ( Invisible comment: 
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII…I
> Before you create the issue:
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
> Search for similar report among other reported issues.
> Learn how to troubleshoot at https://www.mautic.org/docs/en/tips/troubleshooting.html
> Use drag&drop to attach images or other files )
> 
> \## Bug Description
> 
> I setup a custom preference center landing page. It is published with a template in code mode and is in language fr. I send an email where I have assigned this preference center landing page to it. The email is in language fr and is using the template blank. When I click on the unsubscribe link. I see the template of my landing page encapsulated in the \`message.html.twig\` extends the \`base.html.twig\` templates of the blank template. Moreover, a custom body and html header tags are added to the template.
> 
> The generated HTML : 
>  
> \`\`\`html
> 
> \<!DOCTYPE html\>
> \<html\>
> \<head\>
> \<meta name="viewport" content="width=device-width, initial-scale=1.0"\>
> \<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" /\>
> \<script data-source="mautic"\>
> ...
> \</script\>
> \</head\>
> \<body\>
> \<div\>
>            
> \<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"\>
> \<html\>
> \<body\>
> my preference center landing page code mode content
> \</body\>
> \</html\>
> \</body\>
> \</html\>
> \`\`\`
> 
> I should be able to have a custom template for my custom landing page which is not linked to the template of the email I access the page from and without any modification done by mautic.
> 
> | Q | A
> | --- | ---
> | Mautic version | 3.3.1
> | PHP version | 7.3.27
> | Browser | Chrome
> 
> \### Steps to reproduce
> 
> 1. Setup a custom preference center page with template in code mode
> 2. Send an email with template blank and the previous preference center page assigned to this email
> 3. Click on the unsubscribe link in the email
>  
> \### Log errors
> 
> No errors
> 
> I have tracked it here : 
> 
> In \[PublicControllerL242\](https://github.com/mautic/mautic/blob/37ed5ee87900522c888b09ed3857ad0452fb33df/app/bundles/EmailBundle/Controller/PublicController.php#L242) : 
> 
> \`\`\`php
> $event = new PageDisplayEvent($html, $prefCenter, $params);
> $this-\>get('event\_dispatcher')-\>dispatch(PageEvents::PAGE\_ON\_DISPLAY, $event);
> $html = $event-\>getContent();
> \`\`\`
> 
> Listeners on this event are modifying the custom code of the preference center landing page. This is not the most troublesome part. It could stay as it is. However, the fact that it reuses the email template when we are in \`mautic as code\` template mode for the preference center is troublesome : 
> 
> \`\`\`php
> // here $template is the one from the email from which we clicked on the unsubscribe link.
> $contentTemplate = $this-\>factory-\>getHelper('theme')-\>checkForTwigTemplate(':'.$template.':message.html.php');
> 
> ///...
> 
> $viewParams = \[
> 'email' =\> $email,
> 'lead' =\> $lead,
> 'template' =\> $template,
> 'message' =\> $message,
> \];
> 
> return $this-\>render($contentTemplate, $viewParams);
> \`\`\`
> 
> I can propose a PR if you point me in the correct direction you would like this behavior to be changed/fixed. Maybe something like if custom preference center page is enabled and is a \`mautic\_as\_code\` template, override \`$contentTemplate\` to use a dedicated \`empty.html.twig\` template which just print \`{{ message|raw }}\`.
> 
> \[//\]: # ( Invisible comment:
> Please check for related errors in the latest log file in \[mautic root\]/app/log/ and/or the web server's logs and post them here. Be sure to remove sensitive information if applicable. )
> 
> 
> \<bountysource-plugin\>
> 
> \---
> Want to back this issue? \*\*\[Post a bounty on it!\](https://www.bountysource.com/issues/96997532-mautic-is-changing-my-custom-preference-center-page-based-on-the-email-template?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://www.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>

I think this is it

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 22, 2021, 8:04am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/8 "2021-07-22T08:04:03Z")

</div>

I think the new builder won’t allow me to create the right preference settings on the page…  
So I have to revert to the old builder to test it.  
But it seems to be working for me with the old builder, right pref center settings, right language settings.  
We could test this together on the next Mautic HelpDesk Meetup, sounds like an interesting task:  
[https://www.meetup.com/mautic-helpdesk-meetup/](https://www.meetup.com/mautic-helpdesk-meetup/)

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [July 22, 2021, 9:46am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/9 "2021-07-22T09:46:26Z")

</div>

I can confirm that for me it does not work either. I have spent many hours with one of our clients on this and we have bashed our heads and still can’t get it working.

@jensolsson (interesting 😉 )

we were trying on 3.3.3 but I also had tried on 3.3.2.

---

<div class="post-metadata">

**Author:** ![grafx77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/grafx77/32/636_2.png) [@grafx77](https://forum.mautic.org/u/grafx77)\
**Post date:** [July 22, 2021, 6:46pm UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/10 "2021-07-22T18:46:43Z")

</div>

> [@mikew](#):
>
> e were trying on 3.3.3 but I also had tried on 3.3.

Thanks for trying bud. It doesn’t work on version 3.3.3, so I can’t really speak for 3.3.2. If you get it working on the 3.3.3 version, please showcase it on a video if you can. I can do the same to show you it doesn’t work.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 22, 2021, 7:18pm UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/11 "2021-07-22T19:18:42Z")

</div>

Quick question: which Landing Page builder do you guys use?

---

<div class="post-metadata">

**Author:** ![grafx77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/grafx77/32/636_2.png) [@grafx77](https://forum.mautic.org/u/grafx77)\
**Post date:** [July 22, 2021, 7:44pm UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/12 "2021-07-22T19:44:59Z")

</div>

It’s the only one you should be using with this…the Mautic landing pages.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 22, 2021, 11:19pm UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/13 "2021-07-22T23:19:49Z")

</div>

Let me rephrase my question: which landing page BUILDER are you using? The GrapesJs or the legacy builder? Thx.

---

<div class="post-metadata">

**Author:** ![grafx77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/grafx77/32/636_2.png) [@grafx77](https://forum.mautic.org/u/grafx77)\
**Post date:** [July 22, 2021, 11:42pm UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/14 "2021-07-22T23:42:19Z")

</div>

Again…the Mautic landing page builder inside version 3.3.3.

Why would this entail any other builder? It’s literally stated on the original post and documentation link.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 23, 2021, 9:39am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/15 "2021-07-23T09:39:07Z")

</div>

I think the best way to proceed is to assume it’s the legacy builder. I’ll make the screenshots.  
Joey

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 23, 2021, 11:41am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/16 "2021-07-23T11:41:46Z")

</div>

This is 3.3.2, but I don’t see a reason why it should not work on 3.3.3.

Would love to hear what you are doing differently, so we can do an improvement in the email TT 😃

Enjoy.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [July 25, 2021, 5:38pm UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/17 "2021-07-25T17:38:54Z")

</div>

Confirmed working with 3.2.4. Still struggling with 3.3.3…

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 26, 2021, 7:52am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/18 "2021-07-26T07:52:24Z")

</div>

Thanks for checking. I’m eager to find it out. If we can narrow to 3.3.2 → 3.3.3, then we know where to look.

---

<div class="post-metadata">

**Author:** ![zwf](https://avatars.discourse-cdn.com/v4/letter/z/f475e1/32.png) [@zwf](https://forum.mautic.org/u/zwf)\
**Post date:** [December 2, 2021, 8:21am UTC](https://forum.mautic.org/t/custom-unsubscribe-page-does-not-work/20222/19 "2021-12-02T08:21:01Z")

</div>

Hello, is it OK to modify the unsubscription page with Mautic 4.0 ?
