Magento get info newsletter subscribe

magento

You want get info newsletter subscribe of account logged, you can check that account have subscribed or not.
Below is code get info subscribe of customer from email address.

You can see:

<?php
if(Mage::getSingleton('customer/session')->isLoggedIn()){ //check if logged
	$email = Mage::getSingleton('customer/session')->getCustomer()->getData('email'); //get email of current account
	$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email); //get data by that email
	if($subscriber->getId())
	{
		echo '<pre>';
		var_dump($subscriber->getData());
		echo '</pre>';
	}
}
?>

 

Thanks for watching!