cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling Welcome Email

SOLVED

Disabling Welcome Email

Hi,

What is the best way to disable the welcome email that customer receives upon registration?

 

I want to use a marketing software platform to handle it, however, I do not want our customers to receive two different welcome emails.

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Disabling Welcome Email

@Keren 

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="Vendore\Extension\Plugin\EmailNotification" sortOrder="1"/>
    </type>

</config>
Use the below code in the EmailNotification.php file at app/code/Vendor/Extension/Plugin
<?php

namespace Vendore\Extension\Plugin;
class EmailNotification
{
    public function aroundNewAccount(\Magento\Customer\Model\EmailNotification $subject, \Closure $proceed)
    {
        return $subject;
    }
}
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

1 REPLY 1

Re: Disabling Welcome Email

@Keren 

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="Vendore\Extension\Plugin\EmailNotification" sortOrder="1"/>
    </type>

</config>
Use the below code in the EmailNotification.php file at app/code/Vendor/Extension/Plugin
<?php

namespace Vendore\Extension\Plugin;
class EmailNotification
{
    public function aroundNewAccount(\Magento\Customer\Model\EmailNotification $subject, \Closure $proceed)
    {
        return $subject;
    }
}
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.