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


PHP Order::sendNewOrderEmail方法代码示例

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


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

示例1: send

 /**
  * Send email about new order.
  * Process mail exception
  *
  * @param Order $order
  * @return bool
  */
 public function send(Order $order)
 {
     try {
         $order->sendNewOrderEmail();
     } catch (\Magento\Framework\Mail\Exception $exception) {
         $this->logger->logException($exception);
         $this->messageManager->addWarning(__('You did not email your customer. Please check your email settings.'));
         return false;
     }
     return true;
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:18,代码来源:EmailSender.php

示例2: _registerPaymentAuthorization

 /**
  * Register authorized payment
  *
  * @return void
  */
 protected function _registerPaymentAuthorization()
 {
     /** @var $payment \Magento\Sales\Model\Order\Payment */
     $payment = $this->_order->getPayment();
     if ($this->_order->canFetchPaymentReviewUpdate()) {
         $payment->registerPaymentReviewAction(\Magento\Sales\Model\Order\Payment::REVIEW_ACTION_UPDATE, true);
     } else {
         $this->_importPaymentInformation();
         $payment->setPreparedMessage($this->_createIpnComment(''))->setTransactionId($this->getRequestData('txn_id'))->setParentTransactionId($this->getRequestData('parent_txn_id'))->setIsTransactionClosed(0)->registerAuthorizationNotification($this->getRequestData('mc_gross'));
     }
     if (!$this->_order->getEmailSent()) {
         $this->_order->sendNewOrderEmail();
     }
     $this->_order->save();
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:20,代码来源:Ipn.php

示例3: _processOrder

 /**
  * Operate with order using information from silent post
  *
  * @param \Magento\Sales\Model\Order $order
  * @return void
  * @throws \Magento\Framework\Model\Exception
  */
 protected function _processOrder(\Magento\Sales\Model\Order $order)
 {
     $response = $this->getResponse();
     $payment = $order->getPayment();
     $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0);
     $canSendNewOrderEmail = true;
     if ($response->getResult() == self::RESPONSE_CODE_FRAUDSERVICE_FILTER || $response->getResult() == self::RESPONSE_CODE_DECLINED_BY_FILTER) {
         $canSendNewOrderEmail = false;
         $fraudMessage = $this->_getFraudMessage() ? $response->getFraudMessage() : $response->getRespmsg();
         $payment->setIsTransactionPending(true)->setIsFraudDetected(true)->setAdditionalInformation('paypal_fraud_filters', $fraudMessage);
     }
     if ($response->getAvsdata() && strstr(substr($response->getAvsdata(), 0, 2), 'N')) {
         $payment->setAdditionalInformation('paypal_avs_code', substr($response->getAvsdata(), 0, 2));
     }
     if ($response->getCvv2match() && $response->getCvv2match() != 'Y') {
         $payment->setAdditionalInformation('paypal_cvv2_match', $response->getCvv2match());
     }
     switch ($response->getType()) {
         case self::TRXTYPE_AUTH_ONLY:
             $payment->registerAuthorizationNotification($payment->getBaseAmountAuthorized());
             break;
         case self::TRXTYPE_SALE:
             $payment->registerCaptureNotification($payment->getBaseAmountAuthorized());
             break;
         default:
             break;
     }
     $order->save();
     try {
         if ($canSendNewOrderEmail) {
             $order->sendNewOrderEmail();
         }
         $this->_quoteFactory->create()->load($order->getQuoteId())->setIsActive(false)->save();
     } catch (\Exception $e) {
         throw new \Magento\Framework\Model\Exception(__('We cannot send the new order email.'));
     }
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:44,代码来源:Payflowlink.php


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