Skip to content

Instantly share code, notes, and snippets.

@pierreandreroy
Created August 16, 2013 17:45
Show Gist options
  • Save pierreandreroy/6251943 to your computer and use it in GitHub Desktop.
Save pierreandreroy/6251943 to your computer and use it in GitHub Desktop.
Get list of newsletter template in Magento.
<?php
$template_info = array();
$template_collection = Mage::getResourceSingleton('newsletter/template_collection');
if(!empty($template_collection)){
$cnt = 0;
foreach($template_collection as $template){
$template_info[$cnt]['id'] = $template->getTemplateId();
$template_info[$cnt]['code'] = $template->getTemplateCode();
$cnt++;
}
}else{
Mage::getSingleton('adminhtml/session')->addError('No templates found');
return false;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment