2

I am using Magneto 2.3.1 and how to add customer mass-action inside link add reset forget password and when select customer sent to email for customer, but email not use in default Magento our custom email assign and set it.

If this type of work and idea reply me...

  • can you elaborate more. – Anas Mansuri Oct 18 at 11:48
  • please check this one - magento.stackexchange.com/questions/160823/… – Anas Mansuri Oct 18 at 11:50
  • but i need to not this one i need custom email template call in customer mass action inside resetpassowrd click than email sent it so how to possible thatif you see in admin side like subscriber link shows in mass inside same it work on my reset forgot password – Rv Singh Oct 18 at 12:05
  • check with my answer to add foreach in my code for emails. – Anas Mansuri Oct 21 at 4:53
0

Please use below code in controller :

public function __construct(
    Magento\Framework\App\Action\Context $context,
    Magento\Customer\Model\Session $customerSession,
    Magento\Customer\Api\AccountManagementInterface $customerAccountManagement,
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    parent::__construct($context);
}


public function sendCustomMail()
{

            $email = 'customermail@example.com'; // loop your email.


            try {
                $this->customerAccountManagement->initiatePasswordReset(
                    $email,
                    AccountManagement::EMAIL_RESET
                );
            } catch (NoSuchEntityException $e) {
                // Do nothing, we don't want anyone to use this action to determine which email accounts are registered.
            } catch (\Exception $exception) {
                $this->messageManager->addExceptionMessage(
                    $exception,
                    __('We\'re unable to send the password reset email.')
                );
            }
            $this->messageManager->addSuccessMessage($this->getSuccessMessage($email));
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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