@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | Craft::$app->session->setNotice(Craft::t('contact-form-extensions', 'The Contact Form plugin is not installed or activated, Contact Form Extensions does not work without it.')); |
86 | 86 | } |
87 | 87 | |
88 | - Event::on(View::class, View::EVENT_BEFORE_RENDER_TEMPLATE, function (TemplateEvent $e) { |
|
88 | + Event::on(View::class, View::EVENT_BEFORE_RENDER_TEMPLATE, function(TemplateEvent $e) { |
|
89 | 89 | if ( |
90 | 90 | $e->template === 'settings/plugins/_settings' && |
91 | 91 | $e->variables['plugin'] === $this |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | } |
99 | 99 | }); |
100 | 100 | |
101 | - Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, function (RegisterUrlRulesEvent $event) { |
|
101 | + Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, function(RegisterUrlRulesEvent $event) { |
|
102 | 102 | $event->rules = array_merge($event->rules, [ |
103 | 103 | 'contact-form-extensions/submissions/<submissionId:\d+>' => 'contact-form-extensions/submissions/show-submission', |
104 | 104 | 'contact-form-extensions/submissions/<submissionId:\d+>/<siteHandle:{handle}>' => 'contact-form-extensions/submissions/show-submission', |
105 | 105 | ]); |
106 | 106 | }); |
107 | 107 | |
108 | - Event::on(Mailer::class, Mailer::EVENT_BEFORE_SEND, function (SendEvent $e) { |
|
108 | + Event::on(Mailer::class, Mailer::EVENT_BEFORE_SEND, function(SendEvent $e) { |
|
109 | 109 | if ($e->isSpam) { |
110 | 110 | return; |
111 | 111 | } |
@@ -145,15 +145,15 @@ discard block |
||
145 | 145 | } |
146 | 146 | }); |
147 | 147 | |
148 | - Event::on(Mailer::class, Mailer::EVENT_AFTER_SEND, function (SendEvent $e) { |
|
148 | + Event::on(Mailer::class, Mailer::EVENT_AFTER_SEND, function(SendEvent $e) { |
|
149 | 149 | if ($this->settings->enableConfirmationEmail) { |
150 | 150 | // First set the template mode to the Site templates |
151 | 151 | Craft::$app->view->setTemplateMode(View::TEMPLATE_MODE_SITE); |
152 | 152 | |
153 | 153 | // Check if tempplate is overridden in form |
154 | 154 | $template = null; |
155 | - if(array_key_exists('template', $e->submission->message)) { |
|
156 | - $template = '_emails\\' . Craft::$app->security->validateData($e->submission->message['template']); |
|
155 | + if (array_key_exists('template', $e->submission->message)) { |
|
156 | + $template = '_emails\\'.Craft::$app->security->validateData($e->submission->message['template']); |
|
157 | 157 | } else { |
158 | 158 | // Render the set template |
159 | 159 | $template = $this->settings->confirmationTemplate; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | // Create the confirmation email |
167 | 167 | $message = new Message(); |
168 | 168 | $message->setTo($e->submission->fromEmail); |
169 | - if(isset(App::mailSettings()->fromEmail)) { |
|
169 | + if (isset(App::mailSettings()->fromEmail)) { |
|
170 | 170 | $message->setFrom(App::mailSettings()->fromEmail); |
171 | 171 | } else { |
172 | 172 | $message->setFrom($e->message->getTo()); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | Event::on( |
186 | 186 | CraftVariable::class, |
187 | 187 | CraftVariable::EVENT_INIT, |
188 | - function (Event $event) { |
|
188 | + function(Event $event) { |
|
189 | 189 | /** @var CraftVariable $variable */ |
190 | 190 | $variable = $event->sender; |
191 | 191 | $variable->set('contactFormExtensions', ContactFormExtensionsVariable::class); |