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

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

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

And some don’t:

Capture d’écran 2020-08-29 à 12.52.55

Is this normal ? Shouldn’t every contact have a cross on this button to re-enable it ?

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

Go to Contact > Preferences

image

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

image

Good luck,
J

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’écran 2020-08-31 à 19.46.03

When pressing save I have an error 500

Capture d’écran 2020-08-31 à 19.46.54

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 ?

This is bad.

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

JoeyK

An issue is already posted before.

Ah yes indeed, thanks.

Apparently this should be solved in 3.1.1

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

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

Did this and the Do Not Contact tag got removed.