Esempio n. 1
0
 /**
  *
  * @param Mzax_Emarketing_Model_Medium_Email_Snippets $snippets
  * @return void
  */
 public function prepareSnippets(Mzax_Emarketing_Model_Medium_Email_Snippets $snippets)
 {
     $hlp = Mage::helper('mzax_emarketing');
     $snippets->addVar('urls.unsubscribe', $hlp->__('Unsubscribe link'));
     $snippets->addVar('urls.broswer_view', $hlp->__('View in browser link'));
     $snippets->addVar('subject', $hlp->__('Email Subject'));
     $snippets->addVar('address', $hlp->__('Recipient Address'));
     $snippets->addVar('email', $hlp->__('Recipient Email'));
 }
Esempio n. 2
0
 /**
  *
  * @param Mzax_Emarketing_Model_Medium_Email_Snippets $snippets
  * @return void
  */
 public function prepareSnippets(Mzax_Emarketing_Model_Medium_Email_Snippets $snippets)
 {
     $hlp = Mage::helper('mzax_emarketing');
     $snippets->addVar('urls.unsubscribe', $hlp->__('Unsubscribe link'));
     $snippets->addVar('urls.broswer_view', $hlp->__('View in browser link'));
     $snippets->addVar('subject', $hlp->__('Email Subject'));
     $snippets->addVar('address', $hlp->__('Recipient Address'));
     $snippets->addVar('email', $hlp->__('Recipient Email'));
     // requires version 1.6 of sales rule (magento 1.7)
     if (version_compare(Mage::getConfig()->getModuleConfig('Mage_SalesRule')->version, '1.6.0') >= 0) {
         $snippets->addSnippets('mage.coupon', '{{coupon rule="${1:1}" length="${2:8}" expire="${3:120}" prefix="${4:ABC-}" }}', $hlp->__('Coupon Code'), $hlp->__('Generates a coupon code for the specifed shopping cart price rule.'));
     }
 }
Esempio n. 3
0
 public function prepareSnippets(Mzax_Emarketing_Model_Medium_Email_Snippets $snippets)
 {
     $snippets->addVar('customer.firstname', $this->__("Customers Firstname"));
     $snippets->addVar('customer.lastname', $this->__("Customers Lastname"));
     $snippets->addVar('subscriber.status', $this->__("Subscriber Status"));
 }
Esempio n. 4
0
 public function getSnippets()
 {
     $data = $this->getConfig('snippets');
     /* @var $store Mage_Core_Model_Store */
     $store = $this->getConfig('store', Mage::app()->getStore(true));
     if (!$data instanceof Mzax_Emarketing_Model_Medium_Email_Snippets) {
         $data = new Mzax_Emarketing_Model_Medium_Email_Snippets();
     }
     /* @var $variable Mage_Core_Model_Variable */
     foreach (Mage::getResourceModel('core/variable_collection') as $variable) {
         $data->add(array('title' => $this->translate('%s', $variable['name']), 'description' => $this->translate('A custom variable, see Magento Admin -> System -> Custom Variables'), 'snippet' => '{{customVar code=' . $variable['code'] . '}}', 'value' => 'mage.custom_var.' . $variable['code'], 'text' => $variable->getValue($variable::TYPE_TEXT), 'html' => $variable->getValue($variable::TYPE_HTML), 'shortcut' => null));
     }
     $storeContactVariabls = Mage::getModel('core/source_email_variables')->toOptionArray(false);
     foreach ($storeContactVariabls as $var) {
         $path = preg_replace('/\\{\\{config path="(.*)"\\}\\}/i', '$1', $var['value']);
         $data->add(array('title' => $var['label'], 'description' => $var['label'], 'snippet' => $var['value'], 'value' => 'mage.config.' . str_replace('/', '.', $path), 'text' => $store->getConfig($path), 'shortcut' => null));
     }
     $data->add(array('title' => $this->translate("Magento Template Block"), 'description' => $this->translate('Insert html from a php block class'), 'snippet' => '{{block type="${1:core/template}" area="${3:frontend}" template="${2}" }}', 'value' => 'mage.block.insert', 'shortcut' => 'block'));
     if ($this->getConfig('add_widgets', true) && $this->getConfig('widget_window_url')) {
         $data->add(array('title' => $this->translate('Magento Widget'), 'description' => $this->translate('Start magento widget helper tool'), 'snippet' => '{{js:insertWidget}}', 'value' => 'mage.widget', 'shortcut' => 'widget'));
     }
     if ($this->getConfig('add_images', true) && $this->getConfig('files_browser_window_url')) {
         $data->add(array('title' => $this->translate('Magento Image'), 'description' => $this->translate('Start magento image browser'), 'snippet' => '{{js:browserMedia}}', 'value' => 'mage.image', 'shortcut' => 'image'));
     }
     return $data->toArray();
 }