Magneto 2 Custom Module – Load Subscriber Email in PHTML file after newsletter subscription

I am working on a custom module where we need to load the email address of a newsletter subscriber in a phtml file after they subscribe. Our Observer file is triggered on a subscription event and collections the following data: public function execute(\Magento\Framework\Event\Observer $observer){ $event = $observer->getEvent(); $subscriber = $event->getSubscriber(); $email = $subscriber->getEmail(); $promoCode =…

How to call function to get product quantity in Magento 2.3

how to call this function? use Magento\InventorySourceDeductionApi\Model\GetSourceItemBySourceCodeAndSku; … public function __construct( GetSourceItemBySourceCodeAndSku $getSourceItemBySourceCodeAndSku ) { $this->getSourceItemBySourceCodeAndSku = $getSourceItemBySourceCodeAndSku; } … public function doSomething($product, $source) { $sourceItem = $this->getSourceItemBySourceCodeAndSku->execute($sourceCode, $itemSku); return $sourceItem->getQuantity() . ‘<br/>’; // the quantity for the } … Thank you. source: Magento 2.3 – How to fetch stock statuses of all the stores