test templates

This commit is contained in:
Baptiste Lemoine 2020-04-12 17:41:06 +02:00
parent 1e9c5074b2
commit ca7dcceda7
2 changed files with 22 additions and 2 deletions

View File

@ -265,6 +265,12 @@ class PollController extends AbstractController {
$emailChoicesTemplates = [
'creation_poll' => 'creation-mail.html.twig',
'creation_comment' => 'comment-notification.html.twig',
'creation_vote' => 'vote-notification.html.twig',
];
$emailChoicesTitles = [
'creation_poll' => 'Framadate | Création de sondage - ' . $poll->getTitle(),
'creation_comment' => 'Framadate | Commentaire de ' . $foundOwner->getPseudo() . ' - sondage ' . $poll->getTitle(),
'creation_vote' => 'Framadate | Commentaire de ' . $foundOwner->getPseudo() . ' - sondage ' . $poll->getTitle(),
];
// $mail_service->sendCreationMailAction( $foundOwner, $poll );
@ -272,9 +278,8 @@ class PollController extends AbstractController {
'owner' => $foundOwner,
'comment' => $comment,
'poll' => $poll,
'url' => $poll->getCustomUrl(),
'title' => 'Création de sondage - ' . $poll->getTitle(),
'email_template' => 'emails/' . $emailChoicesTemplates[ $emailChoice ],
'title' => $emailChoicesTitles[ $emailChoice ],
];
return $this->render( $templateVars[ 'email_template' ], $templateVars );

View File

@ -0,0 +1,15 @@
{#[Framadate] Notification d'un sondage : TESSSSSSSSSST#}
{% extends 'email-base.html.twig' %}
{% block content %}
<strong>
{{ owner.pseudo }}
</strong>
vient de voter au sondage.
{{ owner.votes |length }}
<br>
Vous pouvez retrouver votre sondage avec le lien suivant :
{% include 'emails/partial/admin_link.html.twig' %}
{% include 'emails/partial/public_link.html.twig' %}
{% endblock %}