test mail route
This commit is contained in:
parent
a9755e1a03
commit
e6f78e9541
7
app/Resources/views/default/test-email.html.twig
Normal file
7
app/Resources/views/default/test-email.html.twig
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block bigMain %}
|
||||
<h1>tadam test de mail</h1>
|
||||
le contenu
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus doloremque exercitationem provident quae quod soluta sunt velit. Architecto, assumenda deserunt expedita laudantium nemo voluptatem. Atque commodi est iste itaque mollitia. Consequatur cumque cupiditate eveniet facilis illo illum impedit itaque omnis placeat quaerat, quia quidem ratione saepe similique sunt veniam veritatis.
|
||||
{% endblock %}
|
@ -50,3 +50,7 @@ add_selling:
|
||||
|
||||
fos_user:
|
||||
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
|
||||
# emails
|
||||
tktest_mail:
|
||||
path: /test-email
|
||||
defaults: { _controller: AppBundle:Default:email }
|
||||
|
@ -73,6 +73,28 @@ class DefaultController extends Controller {
|
||||
] );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* envoyer un email
|
||||
*/
|
||||
public function emailAction() {
|
||||
$name = "noble barbare";
|
||||
$message = \Swift_Message::newInstance()
|
||||
->setSubject( 'Hello Email' )
|
||||
->setFrom( 'test-symfony-tykayn@meluzine.org' )
|
||||
->setTo( 'tykayn@gmail.com' )
|
||||
->setBody( $this->renderView( 'default/test-email.html.twig',
|
||||
[ 'name' => $name ] ) );
|
||||
$this->get( 'mailer' )->send( $message );
|
||||
|
||||
//return 'yay test de mail';
|
||||
return $this->render(
|
||||
'default/test-email.html.twig',
|
||||
[
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* get user products
|
||||
* @return JsonResponse
|
||||
|
Loading…
Reference in New Issue
Block a user