File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed
Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -951,25 +951,20 @@ public function hookActionCustomerAccountAdd($params)
951951 if (empty ($ params ['newCustomer ' ])) {
952952 return false ;
953953 }
954+
954955 $ id_shop = $ params ['newCustomer ' ]->id_shop ;
955956 $ email = $ params ['newCustomer ' ]->email ;
956- $ newsletter = $ params ['newCustomer ' ]->newsletter ;
957- if (Validate::isEmail ($ email )) {
958- if ($ params ['newCustomer ' ]->newsletter && $ code = Configuration::get ('NW_VOUCHER_CODE ' )) {
959- $ this ->sendVoucher ($ email , $ code );
960- }
961- if ($ params ['newCustomer ' ]->newsletter ) {
962- return (bool ) Db::getInstance ()->execute ('DELETE FROM ' . _DB_PREFIX_ . 'emailsubscription WHERE id_shop= ' . (int ) $ id_shop . ' AND email= \'' . pSQL ($ email ) . "' " );
963- }
957+
958+ if (!Validate::isEmail ($ email )) {
959+ return false ;
964960 }
965961
966- if ($ newsletter ) {
967- if (Configuration::get ('NW_CONFIRMATION_EMAIL ' )) {// send confirmation email
968- $ this ->sendConfirmationEmail ($ params ['newCustomer ' ]->email );
969- }
970- if ($ code = Configuration::get ('NW_VOUCHER_CODE ' )) {// send voucher
971- $ this ->sendVoucher ($ params ['newCustomer ' ]->email , $ code );
962+ if ($ params ['newCustomer ' ]->newsletter ) {
963+ if ($ code = Configuration::get ('NW_VOUCHER_CODE ' )) {
964+ $ this ->sendVoucher ($ email , $ code );
972965 }
966+
967+ return (bool ) Db::getInstance ()->execute ('DELETE FROM ' . _DB_PREFIX_ . 'emailsubscription WHERE id_shop= ' . (int ) $ id_shop . ' AND email= \'' . pSQL ($ email ) . "' " );
973968 }
974969
975970 return true ;
You can’t perform that action at this time.
0 commit comments