
A Contact Form 7 message can contain separate paragraphs, an address block or a short sequence of steps. When that message reaches a CRM as one long line, the cause may be a transformation, a destination field or simply the way the interface displays whitespace. Find which boundary changed before replacing line breaks across the whole workflow.
This guide separates the message’s logical text from its transport encoding and visible presentation. The examples are synthetic and intended for a staging adapter. They do not establish behavior for every CF7 connector or receiving application.
Define the message you intend to preserve
Use a small fixture with ordinary punctuation, two paragraphs and a blank line. Include a comma and quotation marks so the same fixture can expose serialization mistakes later. For example, an invented service request could read:
Please review the sample connector.
Expected: keep the note, including "quoted words".
Observed: the second paragraph is difficult to read.
Decide whether preserving paragraph boundaries is sufficient or whether exact newline bytes matter. Different systems may use LF or CRLF line endings. A documented conversion between them can preserve the logical message even when the bytes differ. Removing every break or replacing the two-character sequence backslash-n everywhere is a different operation.
Use a CF7 textarea for multiline input and map its actual field name. A single-line destination property may not be suitable. The textarea limit guide covers length and destination truncation, which should be checked separately from paragraph handling.
Read JSON escapes at the correct layer
JSON encodes control characters inside strings using escapes. Seeing \n in a raw JSON document can therefore be correct. After a JSON parser decodes the string, the receiving application should have a newline character, not a visible backslash followed by the letter n.
{"message":"First paragraph.\n\nSecond paragraph."}
Use the runtime’s JSON serializer rather than concatenating the document by hand. It handles quotes and control characters together. If you serialize an already serialized message a second time, the next receiver may get visible escapes instead of the intended text. Inspect both the raw request and the decoded string before deciding that data disappeared.
A useful diagnostic records a synthetic fixture’s length and an escaped representation at each boundary. It should not copy real inquiry bodies into general logs. Once you locate the failure, remove temporary verbose tracing and retain only the minimum operational evidence needed to maintain the adapter.
Inspect stored text before blaming the CRM display
Check the destination’s documented long-text or multiline field type. Then compare a permitted readback or export with the value shown in the interface. A compact list view may flatten paragraphs while the detailed record retains them. Conversely, a rich-text editor might display a paragraph structure that its API stores differently.
Specify whether the destination accepts plain text, HTML or a structured rich-text format. They are different contracts. Sending HTML break tags to a plain-text property can leave literal markup in the record. Sending newline characters to a rich-text API without its required structure may also fail to produce the intended paragraphs.
Keep the source message separate from any display copy. If an operator needs a one-line preview, derive it explicitly and preserve the full note elsewhere in the authorized destination. A preview should never become the only surviving version of a detailed inquiry.
Render plain text without treating it as HTML
In a custom browser view, adding a plain string through textContent keeps it as text. Normal HTML whitespace handling may still collapse its breaks visually. A reviewed display rule such as white-space: pre-wrap preserves newline presentation while allowing wrapping within the available width.
MDN documents these two mechanisms separately. Choose a text insertion method and a presentation rule together. Avoid inserting an untrusted message as HTML merely to make its line breaks visible. If an application deliberately supports rich text, use that application’s documented sanitization and formatting path.
Email formatting is another boundary. A notification configured for HTML and a CRM note do not necessarily share a representation. Follow the CF7 HTML email guide for notifications, then verify the connected record independently.
Use a CSV writer for exports
A multiline field can span physical lines inside a quoted CSV field. An export consumer that splits the file on every newline can mistake one inquiry for several records. RFC 4180 documents quoting for embedded line breaks and quotes, although individual importers can have their own dialect requirements.
Generate the export with a CSV library and read it back with the intended consumer. Check record count, column count and the complete message. Do not replace all line breaks with spaces simply to hide a malformed parser. The CSV parsing comparison helps choose an appropriate reader for a custom pipeline.
Finish with an end-to-end acceptance record
Include LF and CRLF fixtures, consecutive blank lines, quoted text, a literal backslash-n sequence and text near the destination’s length limit. For each, write whether the expected result requires exact bytes or equivalent logical paragraphs. Check typed, pasted and imported paths where your workflow uses them.
Identify the first disagreement between input, decoded payload, stored record and display. Correct that step and repeat the same fixtures. A clear acceptance record is more useful than a broad statement that “line breaks work.”
Our Svetlik Analytics for Contact Form 7 plugin provides submission statistics and trends. This site publishes that product. Its outcome visibility does not verify a CRM’s message formatting, so keep the field-preservation evidence alongside your integration’s own maintenance notes.
