Contact CSV import strips out HTML

Mautic Version: 4.4.9
Database: 10.4.20-MariaDB
PHP: 7.4

Client pulls one of two different addresses into emails based on where the client secured a loan. The address is 3 lines of text so it’s pulled in from the database as HTML. This works great through the API but we have 3 campaigns where we manually import a CSV file each day, and the import is stripping out the HTML, so the address appears as one line of text.

So this isn’t a Mautic problem per se, but appears to be a CSV import issue. I’ve tried a number of different ways of adding line feeds or carriage returns in the text field of the CSV with no luck.

Anyone know of a way to get the CSV manual import to work and allow three lines of text formatted properly?

Chris Blair

Am I the only one that’s ever encountered this? I’ve found other marketing automation platforms that have this same issue. On some the workaround is using ASCI characters for line feeds like /n or /n/r but that also doesn’t work on my imports into Mautic. Any suggestions (however crazy) are appreciated :).

I was able to solve this by placing the cell/field text into notepad ++, then downloading an HTML Tag plugin for Notepad ++, which will show you the conversion of HTML tags and other code to it’s “text-only” equivalent. So my HTML was the following:

WebBank<br>Salt Lake City, UT<br>c/o Reprise Financial

You replace the < with & l t ; (remove the spaces) and the > with & g t ; (remove spaces)

Note, you only select the HTML code before running the conversion inside Notepad ++. Also, remember that if you’re sending this information through the API, HTML works just fine. This is only needed for manual CSV uploads that contain HTML. Hope this helps someone.

Chris Blair

1 Like