Skip to content

Commit

Permalink
fix nl in email template text field
Browse files Browse the repository at this point in the history
  • Loading branch information
yurikuzn committed Jan 10, 2017
1 parent 20f15e7 commit 8969866
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions application/Espo/Services/EmailTemplate.php
Expand Up @@ -193,10 +193,15 @@ protected function parseText($type, Entity $entity, $text, $skipLinks = false, $
$value = implode(', ', $valueList);
$value = $this->getLanguage()->translateOption($value, $field, $entity->getEntityType());
} else {
if ($entity->fields[$field]['type'] == 'date') {
if (!isset($entity->fields[$field]['type'])) continue;
$attributeType = $entity->fields[$field]['type'];

if ($attributeType == 'date') {
$value = $this->getDateTime()->convertSystemDate($value);
} else if ($entity->fields[$field]['type'] == 'datetime') {
} else if ($attributeType == 'datetime') {
$value = $this->getDateTime()->convertSystemDateTime($value);
} else if ($attributeType == 'text') {
$value = nl2br($value);
}
}
if (is_string($value) || $value === null || is_scalar($value) || is_callable([$value, '__toString'])) {
Expand Down

0 comments on commit 8969866

Please sign in to comment.