To disable certain B2B emails:
- Add a preference to your module's Vendor\Module\etc\di.xml file to extend the class responsible for sending B2B emails like:
<preference for="Magento\Company\Model\Email\Sender" type="Vendor\Module\Model\Email\SenderOverride" />
- In Vendor\Module\Model\Email\SenderOverride, Override the function that sends the email like:
public function sendAssignSuperUserNotificationEmail(CustomerInterface $customer, $companyId)
{
// don't send email
return $this;
}
If you desire to have this functionality controlled by an admin setting, then you will need to create the following files and lookup the setting in "Vendor\Module\Model\Email\SenderOverride"
- Vendor\Module\etc\adminhtml\system.xml
- Vendor\Module\etc\config.xml
Please reference the Adobe Experience League docs for more info on these files.