本文整理汇总了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;
}
示例2: render
public function render(Varien_Object $row)
{
if (!$row->getEntityId()) {
$row->setEmail($row->getGuestEmail());
}
echo $row->getEmail();
}
示例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));
}
示例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());
}
示例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;
}
示例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());
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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));
}