First you have to Override your Existing File so basically you need to follow such simple steps:
- Create Module OSCP_NewsletterOveride - Path: app/code/OSCP/NewsletterOveride
- Create module.xml file in path app/code/OSCP/NewsletterOveride/etc/module.xml
and paste this code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="OSCP_NewsletterOveride" setup_version="1.0.0">
</module>
</config>
- Create etc/registration.php file -path: app/code/OSCP/NewsletterOveride/registration.php
and paste this code
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'OSCP_NewsletterOveride',
__DIR__
);
Now Enable the Module with command:
php bin/magento module:enable OSCP_NewsletterOveride
This way you can create your Module.
Now you need to Override file by Creating di.xml in etc folder. Set Preferences and Override File.