Browse Source

[backend] Cron : ajout log par email

dev
Guillaume 4 years ago
parent
commit
d3e26c802e
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      backend/controllers/CronController.php

+ 10
- 1
backend/controllers/CronController.php View File

} }
if($producer->active) { if($producer->active) {
Yii::error($producer->name.' : Distribution du '.$date.', '.count($arrayOrders).' commande(s) enregistrée(s), '.$countOrders.' commande(s) payée(s), '.($mailOrdersSend ? 'Récapitulatif de commandes envoyé' : 'Aucun email envoyé'), 'cron-process-orders') ;
$messageLog = $producer->name.' : Distribution du '.$date.', '.count($arrayOrders).' commande(s) enregistrée(s), '.$countOrders.' commande(s) payée(s), '.($mailOrdersSend ? 'Récapitulatif de commandes envoyé' : 'Aucun email envoyé') ;

Yii::$app->mailer->compose()
->setFrom('contact@opendistrib.net')
->setTo('contact@opendistrib.net')
->setSubject('[Opendistrib] Log cron')
->setTextBody($messageLog)
->send();

Yii::error($messageLog, 'cron-process-orders') ;
} }
} }
} }

Loading…
Cancel
Save