当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Object::setEmail方法代码示例

本文整理汇总了PHP中Varien_Object::setEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object::setEmail方法的具体用法?PHP Varien_Object::setEmail怎么用?PHP Varien_Object::setEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Object的用法示例。


在下文中一共展示了Varien_Object::setEmail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCustomerByPost

 public function getCustomerByPost($params)
 {
     $customer = $this->_getCustomer();
     // Patch for custom Contact Us form with ability to change email or name of customer (HDMX-98)
     if ($customer->getId() > 0 && !isset($params['customer_email']) && !isset($params['customer_name'])) {
         return $customer;
     }
     $email = $params['customer_email'];
     $name = $params['customer_name'];
     $customers = Mage::getModel('customer/customer')->getCollection();
     $customers->addAttributeToSelect('*')->addAttributeToFilter('email', $email);
     if ($customers->count() > 0) {
         return $customers->getFirstItem();
     }
     $c = Mage::getModel('customer/customer');
     $c->getEmail();
     $c->setEmail('aaa');
     /** @var Mage_Customer_Model_Customer $address */
     $address = $customers->getFirstItem();
     if ($address->getId()) {
         $customer = new Varien_Object();
         $customer->setName($address->getName());
         $customer->setEmail($address->getEmail());
         $customer->setQuoteAddressId($address->getId());
         return $customer;
     }
     $customer = new Varien_Object();
     $customer->setName($name);
     $customer->setEmail($email);
     return $customer;
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:31,代码来源:Mirasvit_Helpdesk_Helper_Customer.php

示例2: render

 public function render(Varien_Object $row)
 {
     if (!$row->getEntityId()) {
         $row->setEmail($row->getGuestEmail());
     }
     echo $row->getEmail();
 }
开发者ID:santhosh400,项目名称:ecart,代码行数:7,代码来源:Email.php

示例3: last_reply_byTest

 /**
  * @test
  * @loadFixture data
  *
  * @doNotIndex catalog_product_price
  */
 public function last_reply_byTest()
 {
     $ticket = Mage::getModel('helpdesk/ticket')->load(2);
     $rule = Mage::getModel('helpdesk/rule')->load(2);
     $rule->setConditionsSerialized($this->getConditions('last_reply_by', '==', 'customer'));
     $rule->afterLoad();
     $this->assertFalse($rule->validate($ticket));
     $customer = new Varien_Object();
     $customer->setName('John Doe');
     $customer->setEmail('john@example.com');
     $ticket->addMessage('message 1', $customer, false, true);
     $this->assertTrue($rule->validate($ticket));
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:19,代码来源:RuleTest.php

示例4: addMessageUnknownCustomerTest

 /**
  * @test
  * @loadFixture data
  *
  * @doNotIndex catalog_product_price
  */
 public function addMessageUnknownCustomerTest()
 {
     $customer = new Varien_Object();
     $customer->setName('John Doe');
     $customer->setEmail('john@example.com');
     $this->_model->addMessage('message 1', $customer, false, true);
     $message = Mage::getModel('helpdesk/message')->getCollection()->getLastItem();
     $this->assertEquals('message 1', $message->getBody());
     $this->assertEquals(2, $message->getTicketId());
     $this->assertEquals(Mirasvit_Helpdesk_Model_Config::MESSAGE_PUBLIC, $message->getType());
     $this->assertEquals('John Doe', $message->getCustomerName());
     $this->assertEquals('john@example.com', $message->getCustomerEmail());
     $this->assertEquals('John Doe', $this->_model->getLastReplyName());
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:20,代码来源:TicketTest.php

示例5: getFormData

 /**
  * Retrieve form data
  *
  * @return Varien_Object
  */
 public function getFormData()
 {
     $data = $this->getData('form_data');
     if (is_null($data)) {
         $customerFormData = Mage::getSingleton('customer/session')->getCustomerFormData(true);
         $data = new Varien_Object($customerFormData);
         if (empty($customerFormData)) {
             $invitation = $this->getCustomerInvitation();
             if ($invitation->getId()) {
                 // check, set invitation email
                 $data->setEmail($invitation->getEmail());
             }
         }
         $this->setData('form_data', $data);
     }
     return $data;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:22,代码来源:Register.php

示例6: testInitDataObject

 public function testInitDataObject()
 {
     $this->setCurrentStore(0);
     $adminUser = new Varien_Object();
     $adminUser->setUserId(1);
     $adminUser->setUsername('username');
     $adminUser->setEmail('email');
     $adminUser->setFirstname('firstname');
     $adminUser->setLastname('lastname');
     $apiSessionMock = $this->getModelMockBuilder('api/session')->disableOriginalConstructor()->setMethods(array('getUser'))->getMock();
     $apiSessionMock->expects($this->any())->method('getUser')->will($this->returnValue($adminUser));
     $this->replaceByMock('singleton', 'api/session', $apiSessionMock);
     $apiEvent = new DEG_OrderLifecycle_Model_Lifecycle_Event_Api_Event();
     $apiEvent->initDataObject();
     $this->assertEquals(1, $apiEvent->getUserId());
     $this->assertEquals('username', $apiEvent->getUsername());
     $this->assertEquals('email', $apiEvent->getEmail());
 }
开发者ID:beejhuff,项目名称:magento-order-lifecycle,代码行数:18,代码来源:EventTest.php

示例7: testGetEventDataObjectApi

 public function testGetEventDataObjectApi()
 {
     $this->setCurrentStore(0);
     $adminUser = new Varien_Object();
     $adminUser->setUserId(1);
     $adminUser->setUsername('username');
     $adminUser->setEmail('email');
     $adminUser->setFirstname('firstname');
     $adminUser->setLastname('lastname');
     $apiSessionMock = $this->getModelMockBuilder('api/session')->disableOriginalConstructor()->setMethods(array('getUser'))->getMock();
     $apiSessionMock->expects($this->any())->method('getUser')->will($this->returnValue($adminUser));
     $this->replaceByMock('singleton', 'api/session', $apiSessionMock);
     $apiServerMock = $this->getModelMock('api/server', array('getAdapter'));
     $apiServerMock->expects($this->any())->method('getAdapter')->will($this->returnValue('api'));
     $this->replaceByMock('singleton', 'api/server', $apiServerMock);
     $factory = new DEG_OrderLifecycle_Model_Lifecycle_Event_Factory();
     $eventObject = $factory->getEventDataObject();
     $this->assertInstanceOf('DEG_OrderLifecycle_Model_Lifecycle_Event_Api_Event', $eventObject);
 }
开发者ID:beejhuff,项目名称:magento-order-lifecycle,代码行数:19,代码来源:FactoryTest.php

示例8: _prepareCollection

 protected function _prepareCollection()
 {
     $helper = Mage::helper('mailinglist');
     //$data = $helper->getAllSubscribersInfo();
     $data = $helper->getAllSubscribers();
     $total = $helper->getCollectionTotal();
     $current_offset = $helper->getCurrentOffset();
     $collection = new Varien_Data_Collection();
     foreach ($data as $item) {
         $varienObject = new Varien_Object();
         $varienObject->setSubscriberId($item['id']);
         $varienObject->setEmail($item['email']);
         $varienObject->setFirstName($item['first_name']);
         $varienObject->setLastName($item['last_name']);
         $collection->addItem($varienObject);
     }
     parent::setCollection($collection);
     return parent::_prepareCollection();
 }
开发者ID:swsnow,项目名称:lexiconn_mailinglist,代码行数:19,代码来源:Grid.php

示例9: __construct

 /**
  * initialize
  *
  * @access public
  * @author Ultimate Module Creator
  */
 public function __construct()
 {
     $customerSession = Mage::getSingleton('customer/session');
     parent::__construct();
     $data = Mage::getSingleton('customer/session')->getPopupCommentFormData(true);
     $data = new Varien_Object($data);
     // add logged in customer name as nickname
     if (!$data->getName()) {
         $customer = $customerSession->getCustomer();
         if ($customer && $customer->getId()) {
             $data->setName($customer->getFirstname());
             $data->setEmail($customer->getEmail());
         }
     }
     $this->setAllowWriteCommentFlag($customerSession->isLoggedIn() || Mage::getStoreConfigFlag('iou_ultimatepopup/popup/allow_guest_comment'));
     if (!$this->getAllowWriteCommentFlag()) {
         $this->setLoginLink(Mage::getUrl('customer/account/login/', array(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME => Mage::helper('core')->urlEncode(Mage::getUrl('*/*/*', array('_current' => true)) . '#comment-form'))));
     }
     $this->setCommentData($data);
 }
开发者ID:cojaco,项目名称:Iou_UltimatePopUp,代码行数:26,代码来源:Form.php

示例10: editAction

 public function editAction()
 {
     /* Inits edit ticket form */
     $id = $this->getRequest()->getParam('id');
     $ticket = Mage::getModel('helpdeskultimate/ticket');
     $ticket->load($id);
     if ($id !== 0 && !$ticket->getData()) {
         $this->_getSession()->addError($this->__('Couldn\'t load ticket by given ID'));
         return $this->_redirect('*/index/index');
     }
     if ($ticket->isReadOnly()) {
         $format = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
         $datetime = Mage::app()->getLocale()->date($ticket->getLockedAt(), Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
         Mage::getSingleton('adminhtml/session')->addError($this->__("Ticket has been locked by %s at %s", $ticket->getLockedUser()->getName(), $datetime));
     }
     if ($this->getRequest()->getParam('customer_id')) {
         if ($customer = Mage::getModel('customer/customer')->load($this->getRequest()->getParam('customer_id'))) {
             $ticket->setCustomer($customer);
         }
     }
     if ($this->getRequest()->getParam('order_id') && !$id) {
         if ($order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'))) {
             $customer = new Varien_Object();
             $customer->setEmail($order->getCustomerEmail())->setName($order->getCustomerFirstname() . " " . $order->getCustomerLastname())->setId($order->getCustomerId());
             $ticket->setTitle(Mage::helper('helpdeskultimate')->__("Order ID %s", $order->getIncrementId()))->setCustomer($customer)->setStoreId($order->getStore()->getId())->setOrderIncrementalId($order->getIncrementId());
         }
     }
     Mage::register('hdu_ticket_data', $ticket);
     $this->_title($this->__('Help Desk - Tickets'));
     $_title = is_null($ticket->getId()) ? $this->__('Create New Ticket') : '#' . $ticket->getUid();
     $this->_title($_title);
     $this->loadLayout()->_setActiveMenu('helpdeskultimate');
     $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
     $this->_addContent($this->getLayout()->createBlock('core/template')->setTemplate('helpdeskultimate/head.phtml'));
     $this->_addContent($this->getLayout()->createBlock('helpdeskultimate/adminhtml_tickets_edit'))->_addLeft($this->getLayout()->createBlock('helpdeskultimate/adminhtml_tickets_edit_tabs'));
     $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
     $this->renderLayout();
     Mage::getSingleton('adminhtml/session')->setFormData(null);
 }
开发者ID:praxigento,项目名称:mage_app_prxgt_store,代码行数:39,代码来源:TicketController.php

示例11: getCustomerInfoFromOrder

 public function getCustomerInfoFromOrder($order)
 {
     $billingAddress = $order->getBillingAddress();
     $address = new Varien_Object();
     $address->setStreet($billingAddress->getStreet(1));
     $address->setStreetNumber($billingAddress->getStreet(2));
     $address->setComplementary($billingAddress->getStreet(3));
     // optional
     $address->setNeighborhood($billingAddress->getStreet(4));
     $address->setZipcode(Zend_Filter::filterStatic($billingAddress->getPostcode(), 'Digits'));
     $customer = new Varien_Object();
     $customer->setName($order->getCustomerName());
     $customer->setDocumentNumber($order->getCustomerTaxvat());
     $customer->setEmail($order->getCustomerEmail());
     $customer->setPhone($this->splitTelephone($billingAddress->getTelephone()));
     $customer->setSex($this->formatGender($order->getCustomerGender()));
     // optional
     $customer->setBornAt($this->formatDob($order->getCustomerDob()));
     // optional
     $customer->setAddress($address);
     Mage::dispatchEvent('pagarme_get_customer_info_from_order_after', array('order' => $order, 'customer_info' => $customer));
     return $customer;
 }
开发者ID:eneiasramos,项目名称:pagarme-magento,代码行数:23,代码来源:Data.php

示例12: getCustomerId

 public function getCustomerId($createIfNotExists = true)
 {
     $customer = Mage::getSingleton('customer/session')->getCustomer();
     if ($customer->getIuguCustomerId()) {
         // Verify if customer really exists and try create again
         $result = Mage::getSingleton('iugu/api')->getCustomer($customer->getIuguCustomerId());
         if (!$result->getId()) {
             $customer->setIuguCustomerId('');
             $customer->save();
             return $this->getCustomerId();
         }
     } elseif ($createIfNotExists) {
         $customerData = new Varien_Object();
         $customerData->setEmail($customer->getEmail());
         $customerData->setName($customer->getName());
         $customerData->setNotes(Mage::app()->getWebsite()->getName());
         try {
             $result = Mage::getSingleton('iugu/api')->saveCustomer($customerData);
             $customer->setIuguCustomerId($result->getId());
             $customer->save();
         } catch (Exception $e) {
             Mage::throwException($e->getMessage());
         }
     }
     return $customer->getIuguCustomerId();
 }
开发者ID:thiagormartins,项目名称:iugu-magento,代码行数:26,代码来源:Data.php

示例13: registerGuestCustomer

 /**
  * Register on Magento's registry GUEST customer data for MergeVars for on checkout subscribe
  *
  * @param Mage_Sales_Model_Order $order
  * @return void
  */
 public function registerGuestCustomer($order)
 {
     if (Mage::registry('mc_guest_customer')) {
         return;
     }
     $customer = new Varien_Object();
     $customer->setId('guest' . time());
     $customer->setEmail($order->getBillingAddress()->getEmail());
     $customer->setStoreId($order->getStoreId());
     $customer->setFirstname($order->getBillingAddress()->getFirstname());
     $customer->setLastname($order->getBillingAddress()->getLastname());
     $customer->setPrimaryBillingAddress($order->getBillingAddress());
     $customer->setPrimaryShippingAddress($order->getShippingAddress());
     Mage::register('mc_guest_customer', $customer, TRUE);
 }
开发者ID:kirchbergerknorr,项目名称:magemonkey,代码行数:21,代码来源:Data.php

示例14: _buildProfileRequest

 /**
  * Construct a new profile request for the customer
  *
  * @param $payment
  * @param bool $forcedCustomerId
  * @return Varien_Object
  */
 protected function _buildProfileRequest($payment, $forcedCustomerId = false)
 {
     $customer_id = $forcedCustomerId ? null : $this->getCustomer()->getId();
     if (!$customer_id || !$this->isSavingCc()) {
         $customer_id = $payment->getOrder()->getIncrementId() . now();
         // Make up a customer ID so we don't ever have duplicate issues
         $description = "Guest or Unsaved Card";
     } else {
         $description = "Magento Customer ID: {$customer_id}";
     }
     $customerRefNum = $this->getCustomer()->getChasePaymentechCustomerRefNum();
     $billingAddress = $payment->getOrder()->getBillingAddress();
     $customer = new Varien_Object();
     $customer->setEmail($payment->getOrder()->getCustomerEmail())->setId($customer_id)->setDescription($description)->setCustomerRefNum($customerRefNum)->setFirstname($billingAddress->getFirstname())->setLastname($billingAddress->getLastname())->setCompany($billingAddress->getCompany())->setAddress($billingAddress->getStreet(true))->setCity($billingAddress->getCity())->setState($billingAddress->getRegion())->setZip($billingAddress->getPostcode())->setCountry($billingAddress->getCountryId());
     $payment_profile = new Varien_Object();
     $customer->setPaymentProfile($payment_profile);
     $customer->getPaymentProfile()->setCc($payment->getCcNumber())->setCcv($payment->getCcCid())->setExpiration(sprintf('%04d-%02d', $payment->getCcExpYear(), $payment->getCcExpMonth()));
     return $customer;
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:26,代码来源:Gorilla_ChasePaymentech_Model_Gateway.php

示例15: _sendTestContactFormEmail

 private function _sendTestContactFormEmail()
 {
     $postObject = new Varien_Object();
     $postObject->setName("SMTPPro Tester");
     $postObject->setComment("If you get this email then everything seems to be in order.");
     $postObject->setEmail("ashley.schroder@gmail.com");
     $mailTemplate = Mage::getModel('core/email_template');
     /* @var $mailTemplate Mage_Core_Model_Email_Template */
     include Mage::getBaseDir() . '/app/code/core/Mage/Contacts/controllers/IndexController.php';
     $mailTemplate->setDesignConfig(array('area' => 'frontend'))->setReplyTo($postObject->getEmail())->sendTransactional(Mage::getStoreConfig(Mage_Contacts_IndexController::XML_PATH_EMAIL_TEMPLATE), Mage::getStoreConfig(Mage_Contacts_IndexController::XML_PATH_EMAIL_SENDER), Mage::getStoreConfig(Mage_Contacts_IndexController::XML_PATH_EMAIL_RECIPIENT), null, array('data' => $postObject));
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:11,代码来源:IndexController.php


注:本文中的Varien_Object::setEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。