mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Render order should be Twig -> Markdown -> Html
Use unrendered markdown as defaul text template
This commit is contained in:
parent
dc3e521c36
commit
81b28e3938
@ -63,9 +63,11 @@ class MailManager
|
||||
/*
|
||||
* HTML contents
|
||||
*/
|
||||
$templateHtml = Markdown::parse($template->content_html);
|
||||
$templateHtml = $template->content_html;
|
||||
|
||||
$html = Twig::parse($templateHtml, $data);
|
||||
$html = Markdown::parse($html);
|
||||
|
||||
if ($template->layout) {
|
||||
$html = Twig::parse($template->layout->content_html, [
|
||||
'content' => $html,
|
||||
@ -78,16 +80,20 @@ class MailManager
|
||||
/*
|
||||
* Text contents
|
||||
*/
|
||||
if (strlen($template->content_text)) {
|
||||
$text = Twig::parse($template->content_text, $data);
|
||||
if ($template->layout) {
|
||||
$text = Twig::parse($template->layout->content_text, [
|
||||
'content' => $text
|
||||
] + (array) $data);
|
||||
}
|
||||
$templateText = $template->content_text;
|
||||
|
||||
$message->addPart($text, 'text/plain');
|
||||
if (!strlen($template->content_text)) {
|
||||
$templateText = $template->content_html;
|
||||
}
|
||||
|
||||
$text = Twig::parse($templateText, $data);
|
||||
if ($template->layout) {
|
||||
$text = Twig::parse($template->layout->content_text, [
|
||||
'content' => $text
|
||||
] + (array) $data);
|
||||
}
|
||||
|
||||
$message->addPart($text, 'text/plain');
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user