Is it possible to include line breaks in activities created from inbound emails, given that this is implemented in CiviCase? If so are there any suggestions about how to go about implementing this?
Currently long emails, especially if replies are included result in a confusing block of text. This has previously been noted at Inbound Email - Formatting? (emails with HTLM code are ignored), However if the activity is saved to a case and then viewed the line breaks are shown.
To reproduce. - Send an email (with line breaks/paragraphs) that will be recorded as an activity (https://civicrm.org/blog/dahndy/leveraging-civicrm-email-to-activity-processing-in-gmail details how to with gmail) - View the associated activity on the associated contact (search for the email you send the email from) - Note that the email has line breaks/paragraphs removed. - Assign the email activity to a case - View the case - scroll down to the activites tab - view - The same content will be displayed with line breaks.
My understanding is that the contact record Activity View uses the following to display the body of the email: {$values.details|crmStripAlternatives|nl2br} civicrm-core/templates/CRM/Activity/Form/ActivityView.tpl:138
Where as the CiviCase Activity view is using: {$form.details.html} civicrm-core/templates/CRM/Case/Form/Activity.tpl :64
In the database the detail field for inbound email the record is stored as two ALTERNATIVE ITEM's the first as plain text with line breaks, the second with the full html of the inbound email.