Email indentation
13 December 2024
Text is inserted without indentation. It may happen that when you paste text into a field, it changes.
For example, Body on the Email Activity screen. We insert the following text.
After pasting, we get the following result.
The solution is to change our string to a format that supports HTML.
The code below will fix our problem so that it is displayed correctly with indents in the HTML environment, as in the Email Activity field
text = text.Replace("\n", "<br>").Replace("\r", "<br>");
Base.CurrentMessage.Current.Body = text;