Commit b7525ac96051c5a8da85313df9c154b915bf7b37
1 parent
9634f926
controller
Showing
1 changed file
with
4 additions
and
6 deletions
Show diff stats
src/app/frontend/controllers/MenuController.php
... | ... | @@ -1262,14 +1262,12 @@ class MenuController extends \controllers\ControllerBase |
1262 | 1262 | { |
1263 | 1263 | $check = $this->models->getSubscribe()->getOneDataByEmail($data['email']); |
1264 | 1264 | |
1265 | - if( empty($check)) { | |
1266 | - if ($this->models->getSubscribe()->addData($data)) { | |
1267 | - $this->sendmail->addCustomer( 10, $data ); | |
1265 | + if( empty($check) && $this->models->getSubscribe()->addData($data) ) { | |
1266 | + $this->sendmail->addCustomer( 10, $data ); | |
1268 | 1267 | |
1269 | - setcookie("popup", '1', time()+3600); | |
1268 | + setcookie("popup", '1', time()+3600); | |
1270 | 1269 | |
1271 | - return $this->response->redirect([ 'for' => 'homepage', 'language' => $this->lang_name ]); | |
1272 | - } | |
1270 | + return $this->response->redirect([ 'for' => 'homepage', 'language' => $this->lang_name ]); | |
1273 | 1271 | } |
1274 | 1272 | } |
1275 | 1273 | } | ... | ... |