Kaynağa Gözat

[Boutique] Commander : email de confirmation lors d'une modification de commande #1421

feature/souke
Guillaume Bourgeois 1 yıl önce
ebeveyn
işleme
9f03c3ca20
2 değiştirilmiş dosya ile 34 ekleme ve 34 silme
  1. +2
    -0
      common/mail/orderConfirm-html.php
  2. +32
    -34
      producer/controllers/OrderController.php

+ 2
- 0
common/mail/orderConfirm-html.php Dosyayı Görüntüle

@@ -60,6 +60,8 @@ $orderModule = OrderModule::getInstance();
<?php endif; ?>
<?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>.</p>

<p>Retrouvez à tout moment votre commande dans l'espace de votre producteur via l'onglet <a href="<?= Yii::$app->urlManager->createAbsoluteUrl('order/history') ?>">Mes commandes</a>.</p>

<?php $payment_infos = $producerModule->getConfig('option_payment_info') ; ?>
<?php if($payment_infos && strlen($payment_infos) > 0): ?>
<p><strong>Informations de paiement :</strong><br />

+ 32
- 34
producer/controllers/OrderController.php Dosyayı Görüntüle

@@ -476,44 +476,42 @@ class OrderController extends ProducerBaseController
/*
* Envoi email de confirmation
*/
if ($isNewOrder) {

$emailSubject = 'Confirmation de commande';
$emailContentParams = [
'order' => $order,
'pointSale' => $pointSale,
'distribution' => $distribution,
'user' => $user,
'producer' => $producer
];

// au client
if ($producerModule->getConfig('option_email_confirm')) {
\Yii::$app->mailerService->sendFromProducer(
$emailSubject,
'orderConfirm',
$emailContentParams,
$user->email,
$producer
);
$emailSubject = 'Confirmation de commande';
$emailContentParams = [
'order' => $order,
'pointSale' => $pointSale,
'distribution' => $distribution,
'user' => $user,
'producer' => $producer
];

}
// au client
if ($producerModule->getConfig('option_email_confirm')) {
\Yii::$app->mailerService->sendFromProducer(
$emailSubject,
'orderConfirm',
$emailContentParams,
$user->email,
$producer
);

// au producteur
$contactProducer = $producerModule->getMainContact($producer);
if ($producerModule->getConfig('option_email_confirm_producer') && $contactProducer && strlen(
$contactProducer->email
)) {

\Yii::$app->mailerService->sendFromSite(
$emailSubject,
'orderConfirmProducer',
$emailContentParams,
$contactProducer->email
);
}
}

// au producteur
$contactProducer = $producerModule->getMainContact($producer);
if ($producerModule->getConfig('option_email_confirm_producer') && $contactProducer && strlen(
$contactProducer->email
)) {

\Yii::$app->mailerService->sendFromSite(
$emailSubject,
'orderConfirmProducer',
$emailContentParams,
$contactProducer->email
);
}


$order = $orderModule->findOneOrderById($order->id);
$orderModule->initOrder($order);
$orderModule->updateOrderTillerSynchronization($order);

Yükleniyor…
İptal
Kaydet