Firstly, you need to create “di.xml” file at App\code\Vendor\Extension\etc\adminhtml with the below code.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\Notification\MessageList">
<arguments>
<argument name="messages" xsi:type="array">
<item name="AdminQuoteMessages" xsi:type="string">Vendor\Extension\Model\Admin\Quote\Messages</item>
</argument>
</arguments>
</type>
</config>
Once the file is created, you need to create another file at App\code\Vendor\Extension\Model\Admin\Quote\ with the below code and name it as “Messages.php”.
<?php
namespace Vendor\Extension\Model\Admin\Quote;
use Magento\Security\Model\ResourceModel\AdminSessionInfo\Collection;
use Magento\Backend\Model\UrlInterface;
use Magento\Backend\Model\Auth\Session;
use Magento\Framework\Notification\MessageInterface;
class Messages implements MessageInterface
{
protected $backendUrl;
private $adminSessionInfoCollection;
protected $authSession;
public function __construct(
Collection $adminSessionInfoCollection,
UrlInterface $backendUrl,
Session $authSession
) {
$this->authSession = $authSession;
$this->backendUrl = $backendUrl;
$this->adminSessionInfoCollection = $adminSessionInfoCollection;
}
public function getText()
{
$message = __('Admin notification Add Successfully.');
return $message;
}
public function getIdentity()
{
return md5('VENDOR_EXTENSION' . $this->authSession->getUser()->getLogdate());
}
public function isDisplayed()
{
return true;
}
public function getSeverity()
{
// From here you can change notification message type.
return \Magento\Framework\Notification\MessageInterface::SEVERITY_CRITICAL;
}
}
If you more refer link and How to Add Multiple Admin Notification Messages in Magento 2
Thank You...