Skip to content

Commit

Permalink
Merge branch 'release/3.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Nov 9, 2020
2 parents 859fa08 + 4f6d9e2 commit 7405e0b
Show file tree
Hide file tree
Showing 135 changed files with 20,350 additions and 478 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# v3.0.10
## 11/09/2020

1. [](#improved)
* Tweaked default `base.html.twig` template to better support dark-mode clients
* Latest vendor updates
1. [](#bugfix)
* Add missing support for `template:` in body array
* Added check to process markdown with `text/html` content type only

# v3.0.9
## 06/08/2020

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Email
slug: email
type: plugin
version: 3.0.9
version: 3.0.10
testing: false
description: Enables the emailing system for Grav
icon: envelope
Expand Down
9 changes: 7 additions & 2 deletions classes/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function buildMessage(array $params, array $vars = [])
if (is_string($value)) {
$body = $twig->processString($value, $vars);

if ($params['process_markdown']) {
if ($params['process_markdown'] && $params['content_type'] === 'text/html') {
$parsedown = new Parsedown();
$body = $parsedown->text($body);
}
Expand All @@ -202,11 +202,16 @@ public function buildMessage(array $params, array $vars = [])

$body = !empty($body_part['body']) ? $twig->processString($body_part['body'], $vars) : null;

if ($params['process_markdown']) {
if ($params['process_markdown'] && $body_part['content_type'] === 'text/html') {
$parsedown = new Parsedown();
$body = $parsedown->text($body);
}

if (isset($body_part['template'])) {
$vars = array_merge($vars, ['content' => $body]);
$body = $twig->processTemplate($body_part['template'], $vars);
}

$content_type = !empty($body_part['content_type']) ? $twig->processString($body_part['content_type'], $vars) : null;
$charset = !empty($body_part['charset']) ? $twig->processString($body_part['charset'], $vars) : null;

Expand Down
Loading

0 comments on commit 7405e0b

Please sign in to comment.