當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。