How to Disable Welcome Email After Creating New Customer From Admin in Magento 2

A welcome email is the first impression of the Ecommerce store that a company makes with a new customer, blog subscriber, or newsletter subscriber via email.

Magento 2 provides this facility to send a welcome email to newly registered customers. Along with that, it also sends a welcome email if the admin adds a new customer from the admin panel!

But there may be a situation where you would not want to send a welcome email to the customers!

For instance, your store is converting to Magento 2 CMS from any other CMS platform. In that case, you can’t tell your customers to register again in the same store, and so the admin has to create those customers from the backend. It will impact badly if the customer gets a welcome email again.

Or if you are using a third-party customer management system that sends a welcome email already, you would want to skip the default welcome email sent by Magento. Also, in the case of using a custom template for the welcome email, it is only wise to disable the default Magento 2 welcome email that is sent on creating a new account in the store.

In such cases, he would want to disable the welcome email after creating new account from admin in Magento 2.

In all such scenarios, use the below programmatic solution and disable welcome email after creating a new customer from admin in Magento 2 store.

Method to Disable Welcome Email After Creating New Customer From Admin in Magento 2

1. Use the below code in the di.xml file at app/code/Vendor/Extension/etc/adminhtml

<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <type name="\Magento\Customer\Model\EmailNotification">
        <plugin name="disable-email-notification" type="Vendor\Extension\Plugin\EmailNotification" sortOrder="1"/>
    </type>

</config>

2. Use the below code in the EmailNotification.php file at app/code/Vendor/Extension/Plugin

<?php

namespace Vendor\Extension\Plugin;
class EmailNotification
{
    public function aroundNewAccount(\Magento\Customer\Model\EmailNotification $subject, \Closure $proceed)
    {
        return $subject;
    }
}

We have to use the di.xml file located in the adminhtml because email should be disabled if the admin creates a customer from the admin side.

That’s it.

Also, do share the post with Magento Community via social media.

Thank you.

Sanjay Jethva

Article by

Sanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for...