1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

more emails

This commit is contained in:
Baptiste Lemoine 2020-04-12 17:50:25 +02:00
parent ca7dcceda7
commit 7c9b97ac58
3 changed files with 22 additions and 6 deletions

View File

@ -255,7 +255,7 @@ class PollController extends AbstractController {
* @return int * @return int
*/ */
// public function sendCreationMailAction( Owner $admin_user, Poll $poll, \Swift_Mailer $mailer) { // public function sendCreationMailAction( Owner $admin_user, Poll $poll, \Swift_Mailer $mailer) {
public function testSendCreationMailAction( MailService $mail_service, $emailChoice = 'creation_comment' ) { public function testSendCreationMailAction( MailService $mail_service, $emailChoice = 'creation_poll_admin' ) {
$em = $this->getDoctrine()->getRepository( Owner::class ); $em = $this->getDoctrine()->getRepository( Owner::class );
$foundOwner = $em->find( 1 ); $foundOwner = $em->find( 1 );
$poll = $foundOwner->getPolls()[ 0 ]; $poll = $foundOwner->getPolls()[ 0 ];
@ -264,13 +264,19 @@ class PollController extends AbstractController {
$emailChoicesTemplates = [ $emailChoicesTemplates = [
'creation_poll' => 'creation-mail.html.twig', 'creation_poll' => 'creation-mail.html.twig',
'creation_poll_admin' => 'author-mail.html.twig',
'owner_list' => 'owner-list.html.twig',
'expiration' => 'expiration-mail.html.twig',
'creation_comment' => 'comment-notification.html.twig', 'creation_comment' => 'comment-notification.html.twig',
'creation_vote' => 'vote-notification.html.twig', 'creation_vote' => 'vote-notification.html.twig',
]; ];
$emailChoicesTitles = [ $emailChoicesTitles = [
'creation_poll' => 'Framadate | Création de sondage - ' . $poll->getTitle(), 'creation_poll' => 'Framadate | Création de sondage - lien public - ' . $poll->getTitle(),
'creation_comment' => 'Framadate | Commentaire de ' . $foundOwner->getPseudo() . ' - sondage ' . $poll->getTitle(), 'creation_poll_admin' => 'Framadate | Création de sondage - lien admin - ',
'creation_vote' => 'Framadate | Commentaire de ' . $foundOwner->getPseudo() . ' - sondage ' . $poll->getTitle(), 'owner_list' => 'Framadate | Vos sondages créés',
'expiration' => 'Framadate | Notice d\'expiration du sondage '. $poll->getTitle(),
'creation_comment' => 'Framadate | Commentaire de "' . $foundOwner->getPseudo() . '" - sondage ' . $poll->getTitle(),
'creation_vote' => 'Framadate | Vote de "' . $foundOwner->getPseudo() . '" - sondage ' . $poll->getTitle(),
]; ];
// $mail_service->sendCreationMailAction( $foundOwner, $poll ); // $mail_service->sendCreationMailAction( $foundOwner, $poll );

View File

@ -8,11 +8,22 @@
padding: 1em; padding: 1em;
} }
.footer-content{ .footer-content{
margin-top: 1em;
background: #ccc; background: #ccc;
} }
ul { ul {
border-left: 3px solid #ddd; border-left: 3px solid #ddd;
} }
a {
padding: 1em; border-radius: 3px;
background: #7d6c99;
color: #201b27;
margin: 0.5rem 0;
display: inline-block;
}
h1,h2,h3{
color: #3c334a;
}
</style> </style>
<header> <header>
{% block title %} {% block title %}
@ -23,6 +34,7 @@
{% endif %} {% endif %}
<hr> <hr>
{% endblock %} {% endblock %}
{% block stylesheets %}{% endblock %}
</header> </header>
<main> <main>

View File

@ -5,8 +5,6 @@
{{ owner.pseudo }} {{ owner.pseudo }}
</strong> </strong>
vient de voter au sondage. vient de voter au sondage.
{{ owner.votes |length }}
<br> <br>
Vous pouvez retrouver votre sondage avec le lien suivant : Vous pouvez retrouver votre sondage avec le lien suivant :
{% include 'emails/partial/admin_link.html.twig' %} {% include 'emails/partial/admin_link.html.twig' %}