Commit d5c16d59 authored by Mat's avatar Mat

swiftmailer config variables for diverses connexion SMTP

parent 9a94e022
...@@ -28,6 +28,7 @@ composer.phar ...@@ -28,6 +28,7 @@ composer.phar
## PERSO ## PERSO
chmod-cache.sh chmod-cache.sh
mailtest.sh
.git_webhook/ .git_webhook/
.idea/ .idea/
nbproject/ nbproject/
...@@ -11,7 +11,6 @@ parameters: ...@@ -11,7 +11,6 @@ parameters:
locale: fr locale: fr
app.path.legume_images: /uploads/images/legumes app.path.legume_images: /uploads/images/legumes
# Fixe le nommage des variables de plusieurs mots # Fixe le nommage des variables de plusieurs mots
# Attention, ça va disfonctionner, il faut repasser dans tous les javascripts !!!!
jms_serializer.camel_case_naming_strategy.class: JMS\Serializer\Naming\IdenticalPropertyNamingStrategy jms_serializer.camel_case_naming_strategy.class: JMS\Serializer\Naming\IdenticalPropertyNamingStrategy
framework: framework:
...@@ -75,8 +74,12 @@ doctrine: ...@@ -75,8 +74,12 @@ doctrine:
swiftmailer: swiftmailer:
transport: '%mailer_transport%' transport: '%mailer_transport%'
host: '%mailer_host%' host: '%mailer_host%'
port: '%mailer_port%'
encryption: '%mailer_encryption%'
auth_mode: '%mailer_auth_mode%'
username: '%mailer_user%' username: '%mailer_user%'
password: '%mailer_password%' password: '%mailer_password%'
timeout: 10
spool: { type: memory } spool: { type: memory }
# FOSUserBundle Configuration # FOSUserBundle Configuration
......
...@@ -71,15 +71,16 @@ class SendMailCommand extends ContainerAwareCommand ...@@ -71,15 +71,16 @@ class SendMailCommand extends ContainerAwareCommand
case "test": case "test":
$message = (new \Swift_Message('Hello Email')) $message = (new \Swift_Message('[Docker][Symfony][cli] Mail de test '))
->setFrom('postmaster@potage.domainepublic.site') ->setFrom('postmaster@potage.domainepublic.site')
->setTo('mat@collectifs.net') ->setTo('mat@collectifs.net')
->setBody( ->setBody(
'coucou, ceci est un test', 'text/html' 'coucou, ceci est un test',
) 'text/html'
; );
$this->mailer->send($message); $this->mailer->send($message);
$output->writeln('Mail sent.'); $output->writeln('[Docker][Symfony][cli] Mail sent.');
break; break;
...@@ -89,7 +90,7 @@ class SendMailCommand extends ContainerAwareCommand ...@@ -89,7 +90,7 @@ class SendMailCommand extends ContainerAwareCommand
$to = array( 'email' => 'mat@collectifs.net', 'fullName' => 'Matla', 'token' => null ); $to = array( 'email' => 'mat@collectifs.net', 'fullName' => 'Matla', 'token' => null );
$retour = $this->newsletter->sendMail( $retour = $this->newsletter->sendMail(
$to, $to,
"[Potage][cli] envoi de la lettre à une seul destinataire", "[Docker][Symfony][cli][infolettre][single] Mail de test",
$lettre $lettre
); );
$retourMsg = ( $retour === 1 ) ? "\e[1;32mSent\e[0m\n" : "\e[1;31mError\e[0m\n"; $retourMsg = ( $retour === 1 ) ? "\e[1;32mSent\e[0m\n" : "\e[1;31mError\e[0m\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment