|
|
@@ -42,7 +42,9 @@ use common\helpers\GlobalParam; |
|
|
|
use common\helpers\Mailjet; |
|
|
|
use common\helpers\MeanPayment; |
|
|
|
use common\models\CreditHistory; |
|
|
|
use common\models\Distribution; |
|
|
|
use common\models\Order; |
|
|
|
use common\models\PointSale; |
|
|
|
use common\models\UserProducer; |
|
|
|
use producer\models\CreditForm; |
|
|
|
use common\models\User; |
|
|
@@ -250,8 +252,8 @@ class CreditController extends ProducerBaseController |
|
|
|
$order->id_user |
|
|
|
); |
|
|
|
|
|
|
|
// envoi d'un email de confirmation de paiement |
|
|
|
$paramsEmail = [ |
|
|
|
// client : envoi d'un email de confirmation de paiement |
|
|
|
/*$paramsEmail = [ |
|
|
|
'from_email' => $producer->getEmailOpendistrib(), |
|
|
|
'from_name' => $producer->name, |
|
|
|
'to_email' => $user->email, |
|
|
@@ -265,8 +267,30 @@ class CreditController extends ProducerBaseController |
|
|
|
'producer' => $producer, |
|
|
|
] |
|
|
|
] ; |
|
|
|
Mailjet::sendMail($paramsEmail); |
|
|
|
Mailjet::sendMail($paramsEmail);*/ |
|
|
|
|
|
|
|
// producteur : mail de confirmation |
|
|
|
$contactProducer = $producer->getMainContact(); |
|
|
|
$pointSale = PointSale::searchOne(['id' => $order->id_point_sale]); |
|
|
|
$distribution = Distribution::find()->where(['id' => $order->id_distribution])->one(); |
|
|
|
|
|
|
|
$paramsEmail = [ |
|
|
|
'from_email' => $producer->getEmailOpendistrib(), |
|
|
|
'from_name' => $producer->name, |
|
|
|
'to_email' => $contactProducer->email, |
|
|
|
'to_name' => $contactProducer->name, |
|
|
|
'subject' => '[' . $producer->name . '] Confirmation de commande', |
|
|
|
'content_view_text' => '@common/mail/orderConfirmProducer-text.php', |
|
|
|
'content_view_html' => '@common/mail/orderConfirmProducer-html.php', |
|
|
|
'content_params' => [ |
|
|
|
'order' => $order, |
|
|
|
'pointSale' => $pointSale, |
|
|
|
'distribution' => $distribution, |
|
|
|
'user' => $user, |
|
|
|
'producer' => $producer |
|
|
|
] |
|
|
|
]; |
|
|
|
Mailjet::sendMail($paramsEmail); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |