|
|
|
|
|
|
|
|
use common\helpers\Mailjet; |
|
|
use common\helpers\Mailjet; |
|
|
use common\helpers\MeanPayment; |
|
|
use common\helpers\MeanPayment; |
|
|
use common\models\CreditHistory; |
|
|
use common\models\CreditHistory; |
|
|
|
|
|
use common\models\Distribution; |
|
|
use common\models\Order; |
|
|
use common\models\Order; |
|
|
|
|
|
use common\models\PointSale; |
|
|
use common\models\UserProducer; |
|
|
use common\models\UserProducer; |
|
|
use producer\models\CreditForm; |
|
|
use producer\models\CreditForm; |
|
|
use common\models\User; |
|
|
use common\models\User; |
|
|
|
|
|
|
|
|
$order->id_user |
|
|
$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_email' => $producer->getEmailOpendistrib(), |
|
|
'from_name' => $producer->name, |
|
|
'from_name' => $producer->name, |
|
|
'to_email' => $user->email, |
|
|
'to_email' => $user->email, |
|
|
|
|
|
|
|
|
'producer' => $producer, |
|
|
'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 { |
|
|
else { |