1 | <?php |
||
7 | class MailDefinitionProviderSymfony implements ProviderInterface |
||
8 | { |
||
9 | protected $kernel; |
||
10 | protected $twig; |
||
11 | |||
12 | /** |
||
13 | * @param KernelInterface $kernel |
||
14 | * @param \Twig_Environment $twig |
||
15 | */ |
||
16 | public function __construct(KernelInterface $kernel, \Twig_Environment $twig) |
||
21 | |||
22 | /** |
||
23 | * Fetches the definition of a system mail as a string |
||
24 | * |
||
25 | * Here we put in something like "App:your-system-mail" and this class will look up in |
||
26 | * "AppBundle/Resources/emails/your-system-email.xml.twig". Take care not to provide the "Bundle" suffix for the |
||
27 | * name parameter as it is added somewhere behind this lines of this method... |
||
28 | * |
||
29 | * Everything will be parsed by twig which adds immense superpowers to the configuration. You can do everything |
||
30 | * you can imagine. |
||
31 | * |
||
32 | * @param string $name |
||
33 | * @param array $parameters |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | public function fetchMailDefinition($name, $parameters = []) |
||
43 | |||
44 | /** |
||
45 | * @param $name |
||
46 | * |
||
47 | * @return string |
||
48 | * |
||
49 | * @throws \InvalidArgumentException |
||
50 | */ |
||
51 | protected function locateResource($name) |
||
64 | } |
||
65 |