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


PHP Customer::sendNewAccountEmail方法代码示例

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


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

示例1: sendNewAccountEmail

 /**
  * Send email with new account related information
  *
  * @param string $type
  * @param string $backUrl
  * @param string $storeId
  * @return $this
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0')
 {
     if ($this->_scopeConfig->getValue(\Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_DISABLE_CUSTOMER_SUCCESS, 'store', $storeId)) {
         return $this;
     } else {
         return parent::sendNewAccountEmail($type, $backUrl, $storeId);
     }
 }
开发者ID:ThomasNegeli,项目名称:dotmailer-magento2-extension,代码行数:17,代码来源:Customer.php

示例2: testSendNewAccountEmailWithoutStoreId

 public function testSendNewAccountEmailWithoutStoreId()
 {
     $store = $this->getMock('Magento\\Store\\Model\\Store', [], [], '', false);
     $website = $this->getMock('Magento\\Store\\Model\\Website', [], [], '', false);
     $website->expects($this->once())->method('getStoreIds')->will($this->returnValue([1, 2, 3, 4]));
     $this->_storeManager->expects($this->once())->method('getWebsite')->with(1)->will($this->returnValue($website));
     $this->_storeManager->expects($this->once())->method('getStore')->with(1)->will($this->returnValue($store));
     $this->_config->expects($this->exactly(3))->method('getAttribute')->will($this->returnValue($this->_attribute));
     $this->_attribute->expects($this->exactly(3))->method('getIsVisible')->will($this->returnValue(true));
     $methods = ['setTemplateIdentifier', 'setTemplateOptions', 'setTemplateVars', 'setFrom', 'addTo'];
     foreach ($methods as $method) {
         $this->_transportBuilderMock->expects($this->once())->method($method)->will($this->returnSelf());
     }
     $transportMock = $this->getMock('Magento\\Framework\\Mail\\TransportInterface', [], [], '', false);
     $transportMock->expects($this->once())->method('sendMessage')->will($this->returnSelf());
     $this->_transportBuilderMock->expects($this->once())->method('getTransport')->will($this->returnValue($transportMock));
     $this->_model->setData(['website_id' => 1, 'store_id' => 1, 'email' => 'email@example.com', 'firstname' => 'FirstName', 'lastname' => 'LastName', 'middlename' => 'MiddleName', 'prefix' => 'Prefix']);
     $this->_model->sendNewAccountEmail('registered');
 }
开发者ID:ViniciusAugusto,项目名称:magento2,代码行数:19,代码来源:CustomerTest.php

示例3: _sendEmailConfirmation

 /**
  * Send either confirmation or welcome email after an account creation
  *
  * @param CustomerModel $customerModel
  * @param Data\Customer $customer
  * @param string        $redirectUrl
  * @return void
  */
 protected function _sendEmailConfirmation(CustomerModel $customerModel, Data\Customer $customer, $redirectUrl)
 {
     try {
         if ($customerModel->isConfirmationRequired()) {
             $customerModel->sendNewAccountEmail(self::NEW_ACCOUNT_EMAIL_CONFIRMATION, $redirectUrl, $customer->getStoreId());
         } else {
             $customerModel->sendNewAccountEmail(self::NEW_ACCOUNT_EMAIL_REGISTERED, $redirectUrl, $customer->getStoreId());
         }
     } catch (MailException $e) {
         // If we are not able to send a new account email, this should be ignored
         $this->logger->logException($e);
     }
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:21,代码来源:CustomerAccountService.php


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