Browse Source

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

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
9f03c3ca20
2 changed files with 34 additions and 34 deletions
  1. +2
    -0
      common/mail/orderConfirm-html.php
  2. +32
    -34
      producer/controllers/OrderController.php

+ 2
- 0
common/mail/orderConfirm-html.php View File

<?php endif; ?> <?php endif; ?>
<?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>.</p> <?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 $payment_infos = $producerModule->getConfig('option_payment_info') ; ?>
<?php if($payment_infos && strlen($payment_infos) > 0): ?> <?php if($payment_infos && strlen($payment_infos) > 0): ?>
<p><strong>Informations de paiement :</strong><br /> <p><strong>Informations de paiement :</strong><br />

+ 32
- 34
producer/controllers/OrderController.php View File

/* /*
* Envoi email de confirmation * 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); $order = $orderModule->findOneOrderById($order->id);
$orderModule->initOrder($order); $orderModule->initOrder($order);
$orderModule->updateOrderTillerSynchronization($order); $orderModule->updateOrderTillerSynchronization($order);

Loading…
Cancel
Save