1 | <?php |
||
9 | class BladeOnDemandRenderer |
||
10 | { |
||
11 | /** |
||
12 | * @var \Illuminate\View\Factory |
||
13 | */ |
||
14 | private $viewFactory; |
||
15 | |||
16 | /** |
||
17 | * @var \Illuminate\Mail\Markdown |
||
18 | */ |
||
19 | private $markdown; |
||
20 | |||
21 | /** |
||
22 | * @var \TijsVerkoyen\CssToInlineStyles\CssToInlineStyles |
||
23 | */ |
||
24 | private $cssInliner; |
||
25 | |||
26 | public function __construct(ViewFactory $viewFactory, Markdown $markdown, CssToInlineStyles $cssInliner) |
||
32 | |||
33 | /** |
||
34 | * Renders the content with the given data. |
||
35 | * |
||
36 | * @param string $contents |
||
37 | * @param array $data |
||
38 | * @return string |
||
39 | */ |
||
40 | public function render(string $contents, array $data = []): string |
||
53 | |||
54 | /** |
||
55 | * Renders the markdown content to a HTML mail. |
||
56 | * |
||
57 | * @param string $contents |
||
58 | * @param array $data |
||
59 | * @return string |
||
60 | */ |
||
61 | public function renderMarkdownMailToHtml(string $contents, array $data = []): string |
||
72 | |||
73 | /** |
||
74 | * Renders the markdown content to a Text mail. |
||
75 | * |
||
76 | * @param string $contents |
||
77 | * @param array $data |
||
78 | * @return string |
||
79 | */ |
||
80 | public function renderMarkdownMailToText(string $contents, array $data = []): string |
||
88 | |||
89 | /** |
||
90 | * Parses the markdown content. |
||
91 | * |
||
92 | * @param string $contents |
||
93 | * @param array $data |
||
94 | * @return string |
||
95 | */ |
||
96 | public function parseMarkdownMail(string $contents, array $data = []): string |
||
100 | } |
||
101 |