Line-breaks in multiple line textbox will show as a single line in email notifications. Is there a workaround for this?
Cognito Forms – Line Breaks in Multiple-Line Textbox Not Showing in Email Notifications
cognito-forms
Related Topic
- Cognito-forms – How to remove the “Powered by Cognito Forms” in email notification
- Cognito-forms – How to configure email notifications in Cognito Forms
- Cognito-forms – Setting up Cognito Form to use a template to handle registration for multiple events
- Cognito-forms – Show Payment Summary line items on Cognito Forms of $0 values
- Cognito-forms – How to attach uploaded files to email notifications from Cognito Forms
- Cognito-forms – “Show next page button when” and multiple choices reported in next question
- Cognito-forms – How to add line breaks for visual formatting of a Cognito form
Best Answer
I am a developer for Cognito Forms.
The same issue occurs when including the field in a content area on the form or the confirmation page. I will cover some of the possible solutions to this. Please comment on this answer to provide feedback.
The text captured from a multiple line textbox contains line breaks, but HTML just treats these as spaces, so when shown in a content field or HTML email message, the line breaks are ignored.
The line breaks cannot be converted into HTML
tags when edited, as this would mess up other usages of the data, like exports to Excel, which rely on the data existing as entered. Also, we have logic in place to prevent HTML and script injection attacks that would remove this content anyway, which is in place to protect our customers.
We could convert line breaks to
tags when building email messages and content areas on the form for these fields. This would leave the data intact. However, this would only apply to line breaks (no other formatting) and also would not be something that could be turned off.
We could also add optional support for markdown (similar to what I am typing now) and support both line breaks and a variety of limited syntax formatting. The advantage to this is it would be an option that could be turned off, but is not obvious to most users.
Again, definitely an issue with no workaround at present, but hopefully this provides some perspective on the issues and possible solutions. Please let us know your thoughts.