Magento 2 Dynamic Front Name
A Magento 2 module that changes the admin front name periodically via cron and sends emails to admins the new backend url.
composer require alaa/magento2-dynamic-front-name
php bin/magento module:enable Alaa_DynamicFrontName
php bin/magento setup:upgrade
php n98-magerun2.phar sys:cron:run backend_front_name_generate
The sending emails is triggered via area code emulation. If Sample Data is installed, then the following plugin from Magento_CustomerSampleData module needs to be disabled because it prevents sending emails via area code emulation.
This module is not responsible for disabling the plugin, so you need to add the following to a
di.xml file in a module with that responsibility.
<type name="Magento\Framework\Mail\TransportInterface"> <plugin name="customer-sample-data-disable-registration-email-send" disabled="true"/> </type>
Also make sure your module depends on Magento_CustomerSampleData and configure in the
<sequence> <module name="Magento_CustomerSampleData" /> </sequence>
Note: Please make sure you don't send emails to customers when disabling this plugin, this plugin was put for a reason which is to prevent customers from getting emails in a test environment. You can do this by removing magento cron entry in the crontab and instead run specific crons using the magerun2 tool.
Feel free to raise issues and contribute.