|
|
|
|
|
|
|
|
'orders' => $arrayOrders |
|
|
'orders' => $arrayOrders |
|
|
] |
|
|
] |
|
|
) |
|
|
) |
|
|
->setFrom([Yii::$app->params['adminEmail'] => 'distrib']) |
|
|
|
|
|
->setSubject($subject);; |
|
|
|
|
|
|
|
|
->setFrom([Yii::$app->params['adminEmail'] => 'distrib']); |
|
|
|
|
|
|
|
|
if (is_array($arrayOrders) && count($arrayOrders)) { |
|
|
if (is_array($arrayOrders) && count($arrayOrders)) { |
|
|
$subject = '[distrib] Commandes du ' . date('d/m', strtotime($date)); |
|
|
$subject = '[distrib] Commandes du ' . date('d/m', strtotime($date)); |
|
|
|
|
|
|
|
|
$subject = '[distrib] Aucune commande'; |
|
|
$subject = '[distrib] Aucune commande'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$mail->setSubject($subject); |
|
|
|
|
|
|
|
|
// envoi des emails à tous les comptes users (statut producer) associés à ce producteur |
|
|
// envoi des emails à tous les comptes users (statut producer) associés à ce producteur |
|
|
$userArray = User::searchAll([ |
|
|
$userArray = User::searchAll([ |
|
|
'id_producer' => $producer->id, |
|
|
'id_producer' => $producer->id, |