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
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;
}
}