I am trying to send welcome email on signup to store 1 only,but not to store 2. but the problem is that when i write plugin ,it sends email to none

1 Answer 1


Using this answer you need to modified following code

use Magento\Customer\Api\Data\CustomerInterface;

class EmailNotification
    public function aroundNewAccount(
        \Magento\Customer\Model\EmailNotification $subject, 
        \Closure $proceed
        CustomerInterface $customer,
        $type = 'registered',
        $backUrl = '',
        $storeId = 0,
        $sendemailStoreId = null
    ) {
        if ( $storeId == 1 ) {
            return $proceed($customer, $type, $backUrl, $storeId, $sendemailStoreId);
        return $subject;

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.