1.Overview

Mautic doesn’t support HTML values in its custom fields by default.
To use the custom field value “Abandoned Cart Products HTML” in your email you are required to add some code in your Mautic core files.

2.Steps to Add Code

Here are the steps listed about how to add that code which is based on Mautic version 3.x or 3.1.0

Note: Backup your files before you make any change.


Step  1:

  • mautic/app/bundles/LeadBundle/Controller/Api/CustomFieldsApiControllerTrait.php

In function “setCustomFieldValues”

At the starting of the function, please replace the existing code with the new customs code by MakeWebBetter (from line #157 to #163) as stated in the screenshot below.

Note: Download this zip file and use the step 1 code for the step 1 process.

html-fields-mautic

Step 2:

  • mautic/app/bundles/LeadBundle/Controller/Api/LeadApiController.php

In function “preSaveEntity”

At the starting of the function, please replace the existing code with the new customs code by MakeWebBetter (from line #566 to #582) as stated in the screenshot below.

Note: Download this zip file and use the step 2 code for the step 2 process.

html-fields-mautic

Step 3:

  • mautic/app/bundles/LeadBundle/Controller/LeadController.php.

In function “editAction”

At the starting of the function, please replace the existing code with the new customs code by MakeWebBetter (from line #624 to #643) as stated in the screenshot below. 

Note: Download this zip file and use the step 3 code for the step 3 process.

html-fields-mautic

Please check the lines below and above the section before adding the code.

Suggest Edit