本文整理汇总了PHP中Mage_Customer_Model_Customer::sendNewAccountEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Customer_Model_Customer::sendNewAccountEmail方法的具体用法?PHP Mage_Customer_Model_Customer::sendNewAccountEmail怎么用?PHP Mage_Customer_Model_Customer::sendNewAccountEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Customer_Model_Customer
的用法示例。
在下文中一共展示了Mage_Customer_Model_Customer::sendNewAccountEmail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _welcomeCustomer
protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
$this->_getSession()->addSuccess($this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()));
if ($this->_isVatValidationEnabled()) {
$configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType();
$userPrompt = '';
switch ($configAddressType) {
case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
break;
default:
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
}
$this->_getSession()->addSuccess($userPrompt);
}
$customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered', '', Mage::app()->getStore()->getId());
$cusromerRedirectStatus = Mage::getStoreConfig('customer/customercreateredirect/active');
$customerCreateRedirectUrl = Mage::getStoreConfig('customer/customercreateredirect/redirecturl');
if ($cusromerRedirectStatus == 1) {
$successUrl = Mage::getUrl() . $customerCreateRedirectUrl;
} else {
$successUrl = Mage::getUrl('*/*/index', array('_secure' => true));
}
if ($this->_getSession()->getBeforeAuthUrl()) {
if ($cusromerRedirectStatus == 1) {
$successUrl = Mage::getUrl() . $customerCreateRedirectUrl;
} else {
$successUrl = $this->_getSession()->getBeforeAuthUrl(true);
}
}
return $successUrl;
}
示例2: _welcomeCustomer
protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
$this->_getSession()->addSuccess($this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()));
if ($this->_isVatValidationEnabled()) {
// Show corresponding VAT message to customer
$configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType();
$userPrompt = '';
switch ($configAddressType) {
case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
break;
default:
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
}
$this->_getSession()->addSuccess($userPrompt);
}
$customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered', '', Mage::app()->getStore()->getId());
if (Mage::getModel("bmicalculator/bmi")->getMyw8status()) {
$successUrl = Mage::getUrl("bmicalculator/index/myw8", array('_secure' => true));
} else {
$successUrl = Mage::getUrl("customer/account/edit", array('_secure' => true));
}
// $successUrl = Mage::getUrl("bmicalculator/index/myw8", array('_secure'=>true));
if ($this->_getSession()->getBeforeAuthUrl()) {
$successUrl = $this->_getSession()->getBeforeAuthUrl(true);
}
return $successUrl;
}
示例3: sendNewAccountEmail
/**
* overwrites the default function
*
* @param string $type
* @param string $backUrl
* @param string $storeId
*
* @return Mage_Customer_Model_Customer|void
*/
public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0')
{
if (Mage::getStoreConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_DISABLE_CUSTOMER_SUCCESS, $storeId)) {
return;
}
parent::sendNewAccountEmail($type, $backUrl, $storeId);
}
示例4: sendNewAccountEmail
/**
* Verifying the referral link registration
*/
public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0')
{
$customer = $this;
$helper = Mage::helper('referralreward');
if ($helper->isEnabled() && ($type == 'registered' || $type == 'confirmed')) {
$invitelink = Mage::app()->getRequest()->getParam('friend_invitelink');
$sessionMark = Mage::getSingleton('customer/session')->getReferralInvitedCustomer();
if ($invitelink || $sessionMark) {
if ($invitelink) {
$pointsItem = Mage::getModel('referralreward/points')->getItemByUrl($invitelink);
} else {
$pointsItem = Mage::getModel('referralreward/points')->getItemByUrl($sessionMark);
}
$friend = Mage::getModel('referralreward/friends')->getItem($pointsItem->getCustomerId(), $customer->getEmail());
if ($friend->getId()) {
$friend->setStatus(Belvg_Referralreward_Model_Friends::FRIEND_BRING)->save();
} else {
$data = array();
$data['friend_name'] = $customer->getFirstname() . ' ' . $customer->getLastname();
$data['friend_email'] = $customer->getEmail();
$data['customer_id'] = $pointsItem->getCustomerId();
$data['status'] = Belvg_Referralreward_Model_Friends::FRIEND_BRING;
$friend->setData($data)->save();
}
$collection = Mage::getModel('referralreward/friends')->getOtherItems($pointsItem->getCustomerId(), $customer->getEmail());
$collection->setDataToAll('status', Belvg_Referralreward_Model_Friends::FRIEND_NO_BRING)->save();
}
$helper->createNewPointsObject($customer->getId());
$helper->getLogModel(Belvg_Referralreward_Model_Points_Log::TYPE_CUSTOMER_REGISTRATION)->supplementPoints($customer);
}
return parent::sendNewAccountEmail($type, $backUrl, $storeId);
}
示例5: _saveCustomerAfterOrder
/**
* Save customer
*
* @param Mage_Customer_Model_Customer $order
*/
protected function _saveCustomerAfterOrder($order)
{
if ($this->_customer) {
if (!$this->_customer->getId()) {
$this->_customer->save();
$order->setCustomerId($this->_customer->getId());
$this->getBillingAddress()->setCustomerId($this->_customer->getId());
$this->getShippingAddress()->setCustomerId($this->_customer->getId());
$this->_customer->sendNewAccountEmail();
} else {
$saveCusstomerAddress = false;
if ($this->getBillingAddress()->getSaveInAddressBook()) {
$billingAddress = $this->getBillingAddress()->exportCustomerAddress();
if ($this->getBillingAddress()->getCustomerAddressId()) {
$billingAddress->setId($this->getBillingAddress()->getCustomerAddressId());
}
$this->_customer->addAddress($billingAddress);
$saveCusstomerAddress = true;
}
if ($this->getShippingAddress()->getSaveInAddressBook()) {
$shippingAddress = $this->getShippingAddress()->exportCustomerAddress();
if ($this->getShippingAddress()->getCustomerAddressId()) {
$shippingAddress->setId($this->getShippingAddress()->getCustomerAddressId());
}
$this->_customer->addAddress($shippingAddress);
$saveCusstomerAddress = true;
}
if ($saveCusstomerAddress) {
$this->_customer->save();
}
}
}
}
示例6: sendNewAccountEmail
public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0')
{
parent::sendNewAccountEmail($type, $backUrl, $storeId);
if ($type == 'registered' || $type == 'confirmed') {
Mage::dispatchEvent('ug_new_customer_campaign_info', array('customer' => $this));
}
return $this;
}
示例7: sendNewAccountEmail
/**
* Send email with new account related information
*
* @param string $type
* @param string $backUrl
* @param string $storeId
* @throws Mage_Core_Exception
* @return Mage_Customer_Model_Customer
*/
public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0')
{
if (Mage::app()->getRequest()->getParam('check_seller_form')) {
$types = array('registered' => self::XML_PATH_REGISTER_SELLER_EMAIL_TEMPLATE, 'confirmed' => self::XML_PATH_CONFIRMED_EMAIL_TEMPLATE, 'confirmation' => self::XML_PATH_CONFIRM_EMAIL_TEMPLATE);
if (!isset($types[$type])) {
Mage::throwException(Mage::helper('customer')->__('Wrong transactional account email type'));
}
if (!$storeId) {
$storeId = $this->_getWebsiteStoreId($this->getSendemailStoreId());
}
$this->_sendEmailTemplate($types[$type], self::XML_PATH_REGISTER_EMAIL_IDENTITY, array('customer' => $this, 'back_url' => $backUrl), $storeId);
return $this;
}
return parent::sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0');
}
示例8: _saveCustomerAfterOrder
/**
* Save customer
*
* @deprecated after 1.4.0.0.
* @param Mage_Customer_Model_Customer $order
*/
protected function _saveCustomerAfterOrder($order)
{
if ($this->_customer) {
if (!$this->_customer->getId()) {
$billing = $this->getBillingAddress();
$customerBilling = $billing->exportCustomerAddress();
$shipping = $this->getShippingAddress();
$customerShipping = $shipping->exportCustomerAddress();
$this->_customer->addAddress($customerBilling);
if (!$shipping->getSameAsBilling()) {
$this->_customer->addAddress($customerShipping);
}
// preliminary save to find addresses id
$this->_customer->save();
// setting default addresses id
$defShipping = $shipping->getSameAsBilling() ? $customerBilling->getId() : $customerShipping->getId();
$this->_customer->setDefaultBilling($customerBilling->getId())->setDefaultShipping($defShipping)->save();
$order->setCustomerId($this->_customer->getId());
$billing->setCustomerId($this->_customer->getId());
$shipping->setCustomerId($this->_customer->getId());
$this->_customer->sendNewAccountEmail('registered', '', $order->getStoreId());
} else {
$saveCusstomerAddress = false;
if ($this->getBillingAddress()->getSaveInAddressBook()) {
$billingAddress = $this->getBillingAddress()->exportCustomerAddress();
if ($this->getBillingAddress()->getCustomerAddressId()) {
$billingAddress->setId($this->getBillingAddress()->getCustomerAddressId());
}
$this->_customer->addAddress($billingAddress);
$saveCusstomerAddress = true;
}
if ($this->getShippingAddress()->getSaveInAddressBook()) {
$shippingAddress = $this->getShippingAddress()->exportCustomerAddress();
if ($this->getShippingAddress()->getCustomerAddressId()) {
$shippingAddress->setId($this->getShippingAddress()->getCustomerAddressId());
}
$this->_customer->addAddress($shippingAddress);
$saveCusstomerAddress = true;
}
if ($saveCusstomerAddress) {
$this->_customer->save();
}
}
}
}
示例9: connectByCreatingAccount
public function connectByCreatingAccount(Mage_Customer_Model_Customer $customer, $email, $firstName, $lastName, $googleId, $token)
{
/*New customer and order set source and campaign*/
$gaCookies = Mage::getModel('nosql/parse_ga')->getCookies();
if (!is_array($gaCookies) || count($gaCookies) <= 0) {
$gaCookies = Mage::helper('common')->getCustomCookies();
}
$source = strtolower($gaCookies['campaign']['source']);
$campaign = strtolower($gaCookies['campaign']['name']);
$customer->setEmail($email)->setFirstname($firstName)->setLastname($lastName)->setSource($source)->setCampaign($campaign)->setInchooGoogleconnectId($googleId)->setInchooGoogleconnectToken($token)->setPassword($customer->generatePassword(10))->save();
$customer->setConfirmation(null);
$customer->save();
$customer->sendNewAccountEmail();
Mage::getSingleton('core/session')->setNewRegistrationUser('complete');
$name = 'nw_user_reg_up';
$ck_reg = Mage::getModel('core/cookie')->get($name);
if ($ck_reg == 'ap56767es') {
Mage::getModel('core/cookie')->set('nw_user_reg', 'ap567es', 3600, '/', null, null, false);
}
Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
}
示例10: _welcomeCustomer
/**
* Add welcome message and send new account email.
* Returns success URL
*
* @param Mage_Customer_Model_Customer $customer
* @param bool $isJustConfirmed
* @return string
*/
protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
$this->_getSession()->addSuccess($this->__('Thank you for registering with %s', Mage::app()->getStore()->getName()));
$customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered');
$successUrl = Mage::getUrl('*/*/index', array('_secure' => true));
if ($this->_getSession()->getBeforeAuthUrl()) {
$successUrl = $this->_getSession()->getBeforeAuthUrl(true);
}
return $successUrl;
}
示例11: _welcomeCustomer
/**
* Function to display welcome message
*
* Display welcome message for seller/ customer
*
* @return void
*/
protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
Mage::getSingleton('customer/session')->addSuccess($this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()));
if ($this->_isVatValidationEnabled()) {
/**
* Show corresponding VAT message to customer
*/
$configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType();
$userPrompt = '';
if ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING) {
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
} else {
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
}
/** add success message in session */
Mage::getSingleton('customer/session')->addSuccess($userPrompt);
}
$customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered', '', Mage::app()->getStore()->getId());
$successUrl = Mage::getUrl('*/*/index', array('_secure' => true));
if (Mage::getSingleton('customer/session')->getBeforeAuthUrl()) {
$successUrl = Mage::getSingleton('customer/session')->getBeforeAuthUrl(true);
}
/** return url */
return $successUrl;
}
示例12: _successProcessRegistrationJson
/**
* Success Registration
*
* @param Mage_Customer_Model_Customer $customer
* @return Mage_Customer_AccountController
*/
protected function _successProcessRegistrationJson(Mage_Customer_Model_Customer $customer)
{
$response = array();
$session = $this->_getSession();
if ($customer->isConfirmationRequired()) {
/** @var $app Mage_Core_Model_App */
$app = $this->_getApp();
/** @var $store Mage_Core_Model_Store*/
$store = $app->getStore();
$customer->sendNewAccountEmail('confirmation', $session->getBeforeAuthUrl(), $store->getId());
$customerHelper = $this->_getHelper('customer');
$response['error'] = $this->__('Account confirmation is required. Please, check your email for the confirmation link. To resend the confirmation email please <a href="%s">click here</a>.', $customerHelper->getEmailConfirmationUrl($customer->getEmail()));
$response['redirect'] = $this->_getUrl('*/*/index', array('_secure' => true));
} else {
$session->setCustomerAsLoggedIn($customer);
$response['redirect'] = $this->_welcomeCustomer($customer);
}
$this->_echoJson($response);
}
示例13: _successProcessRegistration
protected function _successProcessRegistration(Mage_Customer_Model_Customer $customer)
{
$session = $this->_getSession();
if ($customer->isConfirmationRequired()) {
/** @var $app Mage_Core_Model_App */
$app = $this->_getApp();
/** @var $store Mage_Core_Model_Store*/
$store = $app->getStore();
$customer->sendNewAccountEmail('confirmation', $session->getBeforeAuthUrl(), $store->getId());
$customerHelper = $this->_getHelper('customer');
//session
//$session->addSuccess($this->__('Account confirmation is required. Please, check your email for the confirmation link. To resend the confirmation email please <a href="%s">click here</a>.',
//$customerHelper->getEmailConfirmationUrl($customer->getEmail())));
//ito yun dinagdag ko para auto login
$session->setCustomerAsLoggedIn($customer);
$session->renewSession();
$url = $this->_welcomeCustomer($customer);
} else {
$session->setCustomerAsLoggedIn($customer);
$session->renewSession();
$url = $this->_welcomeCustomer($customer);
}
$this->_redirectSuccess($url);
return $this;
}
示例14: _welcomeCustomer
/**
* Customer welcome function
*
* Its used for print welcome message once successfully logged in
*
* @return string customer success page URL.
*/
public function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
/**
* Throws the welcome success message when customer registered successfully
*/
$this->_getCustomerSession()->addSuccess($this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()));
/**
* Send the welcome mail to the customer registered email
*/
$customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered', '', Mage::app()->getStore()->getId());
$successUrl = Mage::getUrl('customer/account', array('_secure' => true));
if ($this->_getCustomerSession()->getBeforeAuthUrl()) {
$successUrl = $this->_getCustomerSession()->getBeforeAuthUrl(true);
}
return $successUrl;
}
示例15: _welcomeCustomer
protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
$text = "<p>" . $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()) . "</p>";
if ($this->_isVatValidationEnabled()) {
// Show corresponding VAT message to customer
$configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType();
$userPrompt = '';
switch ($configAddressType) {
case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
break;
default:
$userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
}
$this->_getSession()->addSuccess($userPrompt);
}
$customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered', '', Mage::app()->getStore()->getId());
return $text . "<p>" . $userPrompt . "</p>";
}