Skip to content

Commit

Permalink
[6.X] Allow packages to use custom markdown mail themes (#30814)
Browse files Browse the repository at this point in the history
* allow packages to use custom markdown mail themes

* add namespace
  • Loading branch information
freekmurze authored and taylorotwell committed Dec 11, 2019
1 parent 086c02a commit 9b695c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Illuminate/Mail/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;
use Parsedown;
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

Expand Down Expand Up @@ -60,8 +61,12 @@ public function render($view, array $data = [], $inliner = null)
'mail', $this->htmlComponentPaths()
)->make($view, $data)->render();

$viewPath = Str::contains($this->theme, '::')
? $this->theme
: 'mail::themes.'.$this->theme;

return new HtmlString(($inliner ?: new CssToInlineStyles)->convert(
$contents, $this->view->make('mail::themes.'.$this->theme, $data)->render()
$contents, $this->view->make($viewPath, $data)->render()
));
}

Expand Down

0 comments on commit 9b695c9

Please sign in to comment.