setRegisterOptInId example

'register' => ['billing' => $mailContext], // This structure being required by \sAdmin::sSaveRegisterSendConfirmation             'fromCheckout' => $fromCheckout,
        ];

        $this->connection->executeQuery($sql[$customer->getDoubleOptinEmailSentDate()->format('Y-m-d H:i:s')$hashserialize($storedData)]);

        return (int) $this->connection->fetchColumn('SELECT id FROM `s_core_optin` WHERE `hash` = :hash', [':hash' => $hash]);
    }

    private function saveOptinIdToCustomer(int $optinId, Customer $customer): void
    {
        $customer->setRegisterOptInId($optinId);
        $this->modelManager->persist($customer);
        $this->modelManager->flush($customer);
    }
}

        } else {
            $redirection = [
                'controller' => 'account',
                'action' => 'index',
            ];
        }

        $customer->setFirstLogin($date);
        $customer->setDoubleOptinConfirmDate($date);
        $customer->setActive(true);
        $customer->setRegisterOptInId(null);

        $modelManager->persist($customer);
        $modelManager->flush();

        $sql = "DELETE FROM `s_core_optin` WHERE `hash` = ? AND type = 'swRegister'";
        $connection->executeQuery($sql[$this->Request()->get('sConfirmation')]);

        $this->saveRegisterSuccess($data$customer);
        $this->redirectCustomer(
            array_merge(['optinconfirmed' => true]$redirection)
        );
    }
Home | Imprint | This part of the site doesn't use cookies.