New mail, new config

This commit is contained in:
Michael RICOIS 2015-06-11 08:09:20 +00:00
parent b14ee7e820
commit 826e4c2837

View File

@ -44,12 +44,6 @@ $application = new Zend_Application(
APPLICATION_PATH . '/configs/application.ini'
);
$c = new Zend_Config($application->getOptions());
Zend_Registry::set('config', $c);
require_once 'WsScore/Configure.php';
$oldconfig = new Configure();
try {
$opts = new Zend_Console_Getopt(
//Options
@ -90,10 +84,12 @@ function getFilePdf($url, $file)
$reportSubject = '';
$reportMsg = '';
$c = new Zend_Config($application->getOptions());
//Lire la base de données - Récupérer les éléments sans fichier
//Connect to the database
try {
$db = Zend_Db::factory($this->dbConfig->db->jo);
$db = Zend_Db::factory($c->profil->db->metier);
$db->getConnection();
} catch (Zend_Db_Adapter_Exception $e) {
@ -102,7 +98,9 @@ try {
}
$baseUrl = 'http://extranetrec.scores-decisions.com/fichier/pdfassociation/actes/';
$path = SECURE_STORAGE . 'associations/actes/';
$path = $c->profil->path->secure . '/associations/actes/';
//Lecture des données
$acteM = new Application_Model_AssoActes($db);
@ -154,11 +152,9 @@ if ($acteList->count()>0) {
$reportMsg = "\n-= CLI getActesAsso.";
//Envoyer un mail de rapport
$mail = new Zend_Mail();
$tr = new Zend_Mail_Transport_Smtp('smtp.celeste.fr');
$mail->setDefaultTransport($tr);
$mail = new Scores_Mail_Method($c->profil->mail);
$mail->setFrom('production@scores-decisions.com', 'Production');
$mail->addTo('support@scores-decisions.com', 'Support');
$mail->setSubject($reportSubject);
$mail->setBodyText(mb_convert_encoding($reportMsg, 'ISO-8859-1', 'UTF-8'));
$mail->send();
$mail->setSubjectC($reportSubject);
$mail->setBodyTextC($reportMsg);