emailing à route via une tache symfony
Bonjour à tous,
J'ai mis en place un moteur d'emailing qui doit être lancer tous les jour sà une heure précise via une tache symfony que j'ai crée.
Le problème c'est que lorsqu'il s'agit d'envoyer un emailing à 10 ou 15 personnes ca marche sans probleme; mais là je dois l'envoyer à 8000 personnes et ca ne marche pas meme pas pour le premier.
Dans mon fichier factories.yml j'ai essayer ces deux strategies d'envoi :spool et realtime rien n'a change
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
prod:
logger:
class: sfNoLogger
param:
level: err
loggers: ~
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: ****
port: ****
encryption:
username:
password: |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
prod:
logger:
class: sfNoLogger
param:
level: err
loggers: ~
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: spool
transport:
class: Swift_SmtpTransport
param:
host: ****
port: ****
encryption:
username:
password: |
ma tache est bien créee dans le dossier lib/task
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
class emailingTask extends sfBaseTask {
protected function configure()
{
// // add your own arguments here
//$this->addArguments(array(new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument')));
$this->addOptions(array(
new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'frontend'),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'prod'),
new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
// add your own options here
));
$this->namespace = 'send';
$this->name = 'emailing';
$this->briefDescription = '';
$this->detailedDescription = <<<EOF
The [send:emailing|INFO] task does things.
Call it with:
[php symfony send:emailing|INFO]
EOF;
}
/* protected function execute($arguments = array(), $options = array())
{
// initialize the database connection
//$databaseManager = new sfDatabaseManager($this->configuration);
//$connection = $databaseManager->getDatabase($options['connection'])->getConnection();
//$this->logSection('say', 'Hello, '.$arguments['my_arg'].'!');
try
{
$client = new SoapClient('http://hyundai.bdmr.fr/hyundai/ws/SimpleWS?wsdl');
$connexion = $client->authenticate('WSDL','buno2010');
}
catch(SoapFault $e)
{
exit ($e->getMessage());
}
$from = 'arnaud2004@yahoo.fr';
$recipient = 'arnaud.femtchou@digikeys.fr';
$subject = 'sujet';
$messageBody = $connexion ;
$mailer = $this->getMailer();
$mailer->composeAndSend($from, $recipient, $subject, $messageBody);
// add your code here
}*/
protected function execute($arguments = array(), $options = array())
{
....
} |
et sur le serveur j'appelle ma tache comme ceci pour qu'elle se lance à 11h37 par exemple
Code:
1 2
|
37 11 * * * /usr/bin/php5 --php-ini /etc/php5/apache2/php.ini /var/www/emailingauto/symfony send:emailing --application="frontend" > /home/result.log |
elle marche bien quand il s'agit d'une petite quantite mais quand on passe la barre des 2000 ! ca merde!!
Au secouuuuuuuuurs!!!!!!!!