Anybody know where magento 2 in adminhtml customer creation, get email template, put it in transport builder, and send mail to customer with cunfirmation link.

1 Answer 1


Check the following class:


protected function sendEmailConfirmation(CustomerInterface $customer, $redirectUrl)
    try {
        $hash = $this->customerRegistry->retrieveSecureData($customer->getId())->getPasswordHash();
        $templateType = self::NEW_ACCOUNT_EMAIL_REGISTERED;
        if ($this->isConfirmationRequired($customer) && $hash != '') {
            $templateType = self::NEW_ACCOUNT_EMAIL_CONFIRMATION;
        } elseif ($hash == '') {
            $templateType = self::NEW_ACCOUNT_EMAIL_REGISTERED_NO_PASSWORD;
        $this->getEmailNotification()->newAccount($customer, $templateType, $redirectUrl, $customer->getStoreId());
    } catch (MailException $e) {
        // If we are not able to send a new account email, this should be ignored
    } catch (\UnexpectedValueException $e) {

The following line is sent email template for resetting the password:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.