Skip to content

Commit

Permalink
Merge pull request #24 from JWardee/hotfix-email-rendering
Browse files Browse the repository at this point in the history
Hotfix for html emails not rendering correctly
  • Loading branch information
JWardee authored Oct 2, 2018
2 parents f1bdc47 + 7b598d0 commit d78d47f
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/Models/Logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,9 @@ static private function dbResultTransform($results, $args = [])
$result['additional_headers'] = explode(PHP_EOL, $result['additional_headers']);
}

if ($args['date_time_format'] == 'human') {
$result['time'] = Carbon::createFromTimestamp($result['time'])->diffForHumans();
} else {
$result['time'] = date($args['date_time_format']);
}

if (GeneralHelper::doesArrayContainSubString($result['additional_headers'], 'text/html')) {
$result['is_html'] = true;
} else {
$result['is_html'] = false;
$result['message'] = htmlspecialchars_decode($result['message']);
}

$result['message'] = stripslashes($result['message']);
$result['time'] = $args['date_time_format'] == 'human' ? Carbon::createFromTimestamp($result['time'])->diffForHumans() : date($args['date_time_format']);
$result['is_html'] = GeneralHelper::doesArrayContainSubString($result['additional_headers'], 'text/html');
$result['message'] = stripslashes(htmlspecialchars_decode($result['message']));

if (!empty($result['attachments'])) {
foreach ($result['attachments'] as &$attachment) {
Expand Down

0 comments on commit d78d47f

Please sign in to comment.