本文整理汇总了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);
}
}
示例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');
}
示例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);
}
}