Ejemplo n.º 1
0
 public function sendEmailCustomerPointChangedNew($customer_id, $data, $store_id)
 {
     $_customer = Mage::getModel('rewardpoints/customer')->load($customer_id);
     $subscribed_balance_update = $_customer->getSubscribedBalanceUpdate();
     if ($this->allowSendEmailNotifications($store_id) && $subscribed_balance_update == 1) {
         $store_name = Mage::getStoreConfig('general/store_information/name', $store_id);
         $sender = Mage::getStoreConfig('rewardpoints/email_notifications/email_sender', $store_id);
         $email = Mage::getModel('customer/customer')->load($customer_id)->getEmail();
         $name = Mage::getModel('customer/customer')->load($customer_id)->getName();
         $teampale = 'rewardpoints/email_notifications/points_balance';
         $sender_name = Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $store_id);
         //$customer_link = Mage::app()->getStore($store_id)->getUrl('rewardpoints/rewardpoints/index');
         $customer_link = Mage::getBaseUrl();
         $data_mail['customer_name'] = $name;
         $data_mail['transaction_amount'] = MW_RewardPoints_Model_Type::getAmountWithSign($data['amount'], $data['type_of_transaction']);
         $data_mail['customer_balance'] = $data['balance'];
         $comment = MW_RewardPoints_Model_Type::getTransactionDetail($data['type_of_transaction'], $data['transaction_detail'], $data['status']);
         $data_mail['transaction_detail'] = $comment;
         $data_mail['transaction_time'] = Mage::helper('core')->formatDate($data['transaction_time']) . " " . Mage::helper('core')->formatTime($data['transaction_time']);
         $data_mail['sender_name'] = $sender_name;
         $data_mail['store_name'] = $store_name;
         $data_mail['customer_link'] = $customer_link;
         $data_mail['email_contact'] = Mage::getStoreConfig('trans_email/ident_support/email', $store_id);
         $data_mail['phone_contact'] = Mage::getStoreConfig('general/store_information/phone', $store_id);
         $this->_sendEmailTransaction($sender, $email, $name, $teampale, $data_mail, $store_id);
     }
 }
Ejemplo n.º 2
0
 public function getPositiveAmount($amount, $type)
 {
     $result = MW_RewardPoints_Model_Type::getAmountWithSign($amount, $type);
     return $result > 0 ? $result : 0;
 }