Skip to content

Instantly share code, notes, and snippets.

@pierreandreroy
Created August 16, 2013 17:57
Show Gist options
  • Save pierreandreroy/6252042 to your computer and use it in GitHub Desktop.
Save pierreandreroy/6252042 to your computer and use it in GitHub Desktop.
Call Magento model (function) from an external file.
<?php
//include Magento app
require_once 'app/Mage.php';
//initialize Magento
Mage::app();
//call Magento model or functions (this example get unsubscription link for customer)
$email = "test@test.com";
$unSubLink = Mage::getModel('newsletter/subscriber')->loadByEmail($email)->getUnsubscriptionLink();
echo $unSubLink;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment