@@ -14,45 +14,45 @@ |
||
14 | 14 | class MailingExtension extends Nette\DI\CompilerExtension |
15 | 15 | { |
16 | 16 | |
17 | - private $defaults = [ |
|
18 | - 'do' => Mail::CONFIG_BOTH, |
|
19 | - 'log_directory' => '%appDir%/../log/mails', |
|
20 | - 'mail_images_base_path' => '%wwwDir%', |
|
21 | - 'mails' => [] |
|
22 | - ]; |
|
17 | + private $defaults = [ |
|
18 | + 'do' => Mail::CONFIG_BOTH, |
|
19 | + 'log_directory' => '%appDir%/../log/mails', |
|
20 | + 'mail_images_base_path' => '%wwwDir%', |
|
21 | + 'mails' => [] |
|
22 | + ]; |
|
23 | 23 | |
24 | 24 | |
25 | - public function loadConfiguration() |
|
26 | - { |
|
27 | - $config = $this->_getConfig(); |
|
25 | + public function loadConfiguration() |
|
26 | + { |
|
27 | + $config = $this->_getConfig(); |
|
28 | 28 | |
29 | - $builder = $this->getContainerBuilder(); |
|
29 | + $builder = $this->getContainerBuilder(); |
|
30 | 30 | |
31 | - $builder->addDefinition($this->prefix('mailLogger')) |
|
32 | - ->setClass('Ublaboo\Mailing\MailLogger') |
|
33 | - ->setArguments([$config['log_directory']]); |
|
31 | + $builder->addDefinition($this->prefix('mailLogger')) |
|
32 | + ->setClass('Ublaboo\Mailing\MailLogger') |
|
33 | + ->setArguments([$config['log_directory']]); |
|
34 | 34 | |
35 | - $builder->addDefinition($this->prefix('mailFactory')) |
|
36 | - ->setClass('Ublaboo\Mailing\MailFactory') |
|
37 | - ->setArguments([$config['do'], $config['mail_images_base_path'], $config['mails']]); |
|
38 | - } |
|
35 | + $builder->addDefinition($this->prefix('mailFactory')) |
|
36 | + ->setClass('Ublaboo\Mailing\MailFactory') |
|
37 | + ->setArguments([$config['do'], $config['mail_images_base_path'], $config['mails']]); |
|
38 | + } |
|
39 | 39 | |
40 | 40 | |
41 | - private function _getConfig() |
|
42 | - { |
|
43 | - $config = $this->validateConfig($this->defaults, $this->config); |
|
41 | + private function _getConfig() |
|
42 | + { |
|
43 | + $config = $this->validateConfig($this->defaults, $this->config); |
|
44 | 44 | |
45 | - $config['log_directory'] = Nette\DI\Helpers::expand( |
|
46 | - $config['log_directory'], |
|
47 | - $this->getContainerBuilder()->parameters |
|
48 | - ); |
|
45 | + $config['log_directory'] = Nette\DI\Helpers::expand( |
|
46 | + $config['log_directory'], |
|
47 | + $this->getContainerBuilder()->parameters |
|
48 | + ); |
|
49 | 49 | |
50 | - $config['mail_images_base_path'] = Nette\DI\Helpers::expand( |
|
51 | - $config['mail_images_base_path'], |
|
52 | - $this->getContainerBuilder()->parameters |
|
53 | - ); |
|
50 | + $config['mail_images_base_path'] = Nette\DI\Helpers::expand( |
|
51 | + $config['mail_images_base_path'], |
|
52 | + $this->getContainerBuilder()->parameters |
|
53 | + ); |
|
54 | 54 | |
55 | - return $config; |
|
56 | - } |
|
55 | + return $config; |
|
56 | + } |
|
57 | 57 | |
58 | 58 | } |
@@ -85,21 +85,21 @@ |
||
85 | 85 | $this->message = new Message; |
86 | 86 | |
87 | 87 | if (class_exists($type)) { |
88 | - $mail = new $type( |
|
89 | - $this->config, |
|
90 | - $this->mails, |
|
91 | - $this->mailer, |
|
92 | - $this->message, |
|
93 | - $this->linkGenerator, |
|
94 | - $this->templateFactory, |
|
95 | - $this->logger, |
|
96 | - $args |
|
97 | - ); |
|
98 | - |
|
99 | - $mail->setBasePath($this->mail_images_base_path); |
|
100 | - |
|
101 | - return $mail; |
|
102 | - } |
|
88 | + $mail = new $type( |
|
89 | + $this->config, |
|
90 | + $this->mails, |
|
91 | + $this->mailer, |
|
92 | + $this->message, |
|
93 | + $this->linkGenerator, |
|
94 | + $this->templateFactory, |
|
95 | + $this->logger, |
|
96 | + $args |
|
97 | + ); |
|
98 | + |
|
99 | + $mail->setBasePath($this->mail_images_base_path); |
|
100 | + |
|
101 | + return $mail; |
|
102 | + } |
|
103 | 103 | |
104 | 104 | throw new MailCreationException("Email [$type] does not exist"); |
105 | 105 | } |