1

Magento 3.2.1. In forgot admin password template it says [email protected] and in the sender it says "owner"

I know I can override the html, I just want to know how to change the variables, aren't those system wide variables? Where are they located? not in customer store -> customer.

2 Answers 2

1

The default is for Magento to use the "Customer Support" email identity when sending the forgot password email. The sender name and email for that identity can be changed from the admin at the following location:

Stores > Settings > Configuration > General > Store Email Addresses

System Configuration - Store Email Addresses

1
  • Thank you, this this the right answer
    – Lynob
    Jun 27, 2019 at 13:44
2

Took me a little while to track functionality down

https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php#L117

Which traces through to this

https://github.com/magento/magento2/blob/80469a61e061abd0001c93497a6d92296b46496b/app/code/Magento/User/Model/Notificator.php#L94

/**
     * Send a notification.
     *
     * @param string $templateConfigId
     * @param array $templateVars
     * @param string $toEmail
     * @param string $toName
     * @throws MailException
     *
     * @return void
     */
    private function sendNotification(
        string $templateConfigId,
        array $templateVars,
        string $toEmail,
        string $toName
    ): void {
        $transport = $this->transportBuilder
            ->setTemplateIdentifier($this->config->getValue($templateConfigId))
            ->setTemplateModel(BackendTemplate::class)
            ->setTemplateOptions([
                'area' => FrontNameResolver::AREA_CODE,
                'store' => Store::DEFAULT_STORE_ID
            ])
            ->setTemplateVars($templateVars)
            ->setFrom(
                $this->config->getValue('admin/emails/forgot_email_identity')
            )
            ->addTo($toEmail, $toName)
            ->getTransport();
        $transport->sendMessage();
    }

So it's whatever sets this config value:

admin/emails/forgot_email_identity

https://github.com/magento/magento2/blob/80469a61e061abd0001c93497a6d92296b46496b/app/code/Magento/User/etc/config.xml#L14

So store > configuration > admin (or if it's missing that was the intention)

Update

Wasn't sure which variables

Hard coded array

https://github.com/magento/magento2/blob/80469a61e061abd0001c93497a6d92296b46496b/app/code/Magento/User/Model/Notificator.php#L109

Passed to template

https://github.com/magento/magento2/blob/f1da36945b71a002218a4047bc0d85c2252d3b5f/app/code/Magento/User/view/adminhtml/email/password_reset_confirmation.html

3
  • Thank you so much for your answer. store > configuration > advanced > admin, I see the template for forgot password, but I don't see where I can change those variable. Do you think they're not variables? They're hardcoded in the template? I don't think so, let me check
    – Lynob
    Jun 26, 2019 at 22:32
  • Wasnt sure what you meant by variables. I've Updated the answer with more detail. Jun 26, 2019 at 23:06
  • strange i can't see support@example still, imgur.com/RaGNoBS like in the screenshot. I'll just modify the template.
    – Lynob
    Jun 27, 2019 at 1:43

Your Answer

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

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