# Action "Remove contact from do not contact list" doesn't work in forms

**URL:** <https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859>\
**Category:** Product Support\
**Created:** [August 29, 2020, 8:21am UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859 "2020-08-29T08:21:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![maumatic](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/maumatic/32/3284_2.png) [@maumatic](https://forum.mautic.org/u/maumatic)\
**Post date:** [August 29, 2020, 8:21am UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/1 "2020-08-29T08:21:41Z")

</div>

**Your software**  
My Mautic version is: 3.1.0  
My PHP version is: 7.3.20  
My MariaDB version is : 10.5

**Your problem**  
My problem is: when submitting a form to subscribe to my mailing list, everything works but the action " Remove contact from do not contact list".  
So if a contact was set to “Do not contact” and people submit the form to subscribe they stay in the state “Do not contact”.

These errors are showing in the log:  
no errors are shown in the logs

Steps I have tried to fix the problem:  
I enabled debugging by adding ‘debug’ =\> true, in local.php but no useful debug info was printed out in the log file

How to reproduce the problem:  
It’s easy:

- have a test contact to unsubscribe using a unsubscribe link in an email
- make a form to subscribe having the action " Remove contact from do not contact list" and use it in a landing page
- go to the landing page to subscribe again with the test contact’s email address
- check if the contact is still in “Do not contact” state

---

<div class="post-metadata">

**Author:** ![maumatic](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/maumatic/32/3284_2.png) [@maumatic](https://forum.mautic.org/u/maumatic)\
**Post date:** [August 31, 2020, 5:35am UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/2 "2020-08-31T05:35:25Z")

</div>

I tried to understand what was going on. I found some contacts have a cross next to “do not contact”

 ![Capture d’écran 2020-08-29 à 12.34.22](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/34567c01941be06699812235597669fd3d3ba208.png)

And some don’t:

![Capture d’écran 2020-08-29 à 12.52.55](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/ff093bd2610338876e13eeb931bfc9e0200f8c10.png)

Is this normal ? Shouldn’t every contact have a cross on this button to re-enable 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:** [August 31, 2020, 1:58pm UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/3 "2020-08-31T13:58:32Z")

</div>

As far as I know it depends if you added manually.

Go to Contact \> Preferences

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/08b900340f74554190c4082ff697145ee73dd8a8.png)

And choose the channel you want to enable / disable (Email)

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/ca2593c7fc6b41958779ead01a553b76e43bf895.png)

Good luck,  
J

---

<div class="post-metadata">

**Author:** ![maumatic](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/maumatic/32/3284_2.png) [@maumatic](https://forum.mautic.org/u/maumatic)\
**Post date:** [August 31, 2020, 6:04pm UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/4 "2020-08-31T18:04:14Z")

</div>

I tried to do something on the Contact Preference Center: I just ticked the checkbox for Email and then pressed save (there’s nothing more I can do: all the fields for the Frequency settings are greyed out)

![Capture d’écran 2020-08-31 à 19.46.03](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cf37f07fd06cb9932dd050d9989c99afb4950a5f.png)

When pressing save I have an error 500

![Capture d’écran 2020-08-31 à 19.46.54](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9a533bcf063a171bf38f2d31a08b562e133b719c.png)

Corresponding to this log line:

`mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedMethodException: "Attempted to call an undefined method named "removeDncForLead" of class "Mautic\LeadBundle\Model\LeadModel"." at /var/www/mmm.mysite.com/app/bundles/LeadBundle/Controller/FrequencyRuleTrait.php line 180 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\UndefinedMethodException(code: 0): Attempted to call an undefined method named \"removeDncForLead\" of class \"Mautic\\LeadBundle\\Model\\LeadModel\". at /var/www/mmm.mysite.com/app/bundles/LeadBundle/Controller/FrequencyRuleTrait.php:180)"} []`

Why would I have an `undefined method named "removeDncForLead"` ?

I looked at that line 180 in FrequencyRuleTrait.php:  
`$leadModel->removeDncForLead($lead, $contactChannel);`

Then I looked into `app/bundles/LeadBundle/Model/LeadModel.php` but didn’t find any definition of `removeDncForLead`. I stopped there…

Any hint ?

---

<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:** [August 31, 2020, 6:16pm UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/5 "2020-08-31T18:16:52Z")

</div>

This is bad.

Just checked it on my install, works the same way as yours. It seems to be a bug.

JoeyK

---

<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:** [September 1, 2020, 6:22am UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/6 "2020-09-01T06:22:44Z")

</div>

An issue is already posted before.

> <https://github.com/mautic/mautic/issues/9017>
>
> Bug Description
> When trying to remove the "Do not contact" tag from a contact a 500 Internal Server Error is thrown.
> 
> Q
> A
> 
> 
> Mautic version
> 3.0.1
> 
> PHP...

---

<div class="post-metadata">

**Author:** ![maumatic](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/maumatic/32/3284_2.png) [@maumatic](https://forum.mautic.org/u/maumatic)\
**Post date:** [September 1, 2020, 6:32am UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/7 "2020-09-01T06:32:58Z")

</div>

Ah yes indeed, thanks.

Apparently this should be solved in 3.1.1

---

<div class="post-metadata">

**Author:** ![maumatic](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/maumatic/32/3284_2.png) [@maumatic](https://forum.mautic.org/u/maumatic)\
**Post date:** [March 17, 2021, 1:32pm UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/8 "2021-03-17T13:32:13Z")

</div>

hi,

My system is now running Mautic v3.3.1 and this problem is still there.

Was anybody able to reproduce the problem ?

- have a test contact to unsubscribe using a unsubscribe link in an email
- make a form to subscribe having the action " Remove contact from do not contact list" and use it in a landing page
- go to the landing page to subscribe again with the test contact’s email address
- check if the contact is still in “Do not contact” state

---

<div class="post-metadata">

**Author:** ![namratasaun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/namratasaun/32/2801_2.png) [@namratasaun](https://forum.mautic.org/u/namratasaun)\
**Post date:** [May 5, 2021, 1:38pm UTC](https://forum.mautic.org/t/action-remove-contact-from-do-not-contact-list-doesnt-work-in-forms/15859/9 "2021-05-05T13:38:07Z")

</div>

> [@maumatic](#):
>
> v3.3.1

I am on Mautic 3.2 and it is working for me.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/48bd0bb560e688c6b316a9ce6a60223e9373bd28.jpeg)

Did this and the Do Not Contact tag got removed.
