From 61cdafe3b80551ae3bd3c8376b577d9f53223748 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Fri, 10 Apr 2020 17:19:18 +0200 Subject: [PATCH 01/12] :zap: refacto email designs --- src/Controller/DefaultController.php | 1 + templates/base.html.twig | 2 +- templates/email-base.html.twig | 38 +++++++ templates/emails/author-mail.html.twig | 14 ++- .../comment-notification-mail.html.twig | 8 +- templates/emails/creation-mail.html.twig | 16 +-- templates/emails/expiration-mail.html.twig | 7 +- templates/emails/footer.html.twig | 24 +++- .../modification-notification-mail.html.twig | 7 +- templates/emails/owner-list.html.twig | 104 +++++++++--------- 10 files changed, 140 insertions(+), 81 deletions(-) create mode 100644 templates/email-base.html.twig diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 6933d5f..0412c62 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -38,6 +38,7 @@ class DefaultController extends AbstractController { $templateVars = [ 'owner' => $founduser, 'polls' => $polls, + 'title' => 'Mes sondages - '.$email, ]; $message = ( new Swift_Message( 'Framadate - mes sondages' ) ) diff --git a/templates/base.html.twig b/templates/base.html.twig index a1b8fd8..34dd070 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -2,7 +2,7 @@ - {% block title %}Welcome!{% endblock %} + {% block title %}Framdate{% endblock %} {% block stylesheets %}{% endblock %} diff --git a/templates/email-base.html.twig b/templates/email-base.html.twig new file mode 100644 index 0000000..2965a4a --- /dev/null +++ b/templates/email-base.html.twig @@ -0,0 +1,38 @@ +
+ + +
+ {% block title %} + {% if title is defined %} +

{{ title }}

+ {% else %} +

Framadate - email

+ {% endif %} +
+ {% endblock %} +
+
+ + {% block content %} + {% endblock %} +
+
+ {% block footer %} + {% include 'emails/footer.html.twig' %} + {% endblock %} +
+ +
diff --git a/templates/emails/author-mail.html.twig b/templates/emails/author-mail.html.twig index 3877200..4adec7e 100644 --- a/templates/emails/author-mail.html.twig +++ b/templates/emails/author-mail.html.twig @@ -1,9 +1,15 @@ {#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#} Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage. - +
Vous pouvez modifier ce sondage à l'adresse suivante : +
+{{ url }} +
+Pour partager votre sondage aux participants, utilisez son lien d'accès public. +
-https://framadate.org/NGutN7jB9vtoGOEjCfUJWBwr/admin +{% if is_password_protected %} + Ce sondage est protégé par un mot de passe, n'oubliez pas de le communiquer à vos participants. +{% else %} -Merci de votre confiance. -Framadate +{% endif %} diff --git a/templates/emails/comment-notification-mail.html.twig b/templates/emails/comment-notification-mail.html.twig index f59fb22..e974021 100644 --- a/templates/emails/comment-notification-mail.html.twig +++ b/templates/emails/comment-notification-mail.html.twig @@ -1,6 +1,4 @@ {#[Framadate] Notification d'un sondage : TESSSSSSSSSST#} -smoi vient de rédiger un commentaire. -Vous pouvez retrouver votre sondage avec le lien suivant : https://framadate.org/NGutN7jB9vtoGOEjCfUJWBwr/admin - -Merci de votre confiance. -Framadate +{{ pseudo }} vient de rédiger un commentaire. +
+Vous pouvez retrouver votre sondage avec le lien suivant : {{ url }} diff --git a/templates/emails/creation-mail.html.twig b/templates/emails/creation-mail.html.twig index 31846b1..2275545 100644 --- a/templates/emails/creation-mail.html.twig +++ b/templates/emails/creation-mail.html.twig @@ -1,11 +1,11 @@ {#[Framadate][Pour diffusion aux sondés] Sondage: TESSSSSSSSSST#} -Ceci est le message qui doit être envoyé aux sondés. -Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote. +Ceci est le message qui doit être envoyé aux sondés.
+Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.
+
+hah vient de créer un sondage intitulé : "{{ title }}".
+Merci de bien vouloir participer au sondage à l'adresse suivante :
+ + {{ url }} + -hah vient de créer un sondage intitulé : "TESSSSSSSSSST". -Merci de bien vouloir participer au sondage à l'adresse suivante : -https://framadate.org/heh-le-test - -Merci de votre confiance. -Framadate diff --git a/templates/emails/expiration-mail.html.twig b/templates/emails/expiration-mail.html.twig index 606e250..468630f 100644 --- a/templates/emails/expiration-mail.html.twig +++ b/templates/emails/expiration-mail.html.twig @@ -1,8 +1,5 @@ {#[Framadate][expiration] Sondage: TESSSSSSSSSST#} Ce sondage va bientôt expirer dans 1 jour, il ne sera plus possible d'y voter. -Dans 31 jours il sera supprimé. Vous pouvez exporter ses données àtotmoment en vous rendant à ce lien pour l'administrer. +Dans 31 jours il sera supprimé. Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer: -https://framadate.org/heh-le-test - -Merci de votre confiance. -Framadate +{{ url }} diff --git a/templates/emails/footer.html.twig b/templates/emails/footer.html.twig index 0fda947..3438b32 100644 --- a/templates/emails/footer.html.twig +++ b/templates/emails/footer.html.twig @@ -1,4 +1,20 @@ -Merci de votre confiance. - - Framadate - + diff --git a/templates/emails/modification-notification-mail.html.twig b/templates/emails/modification-notification-mail.html.twig index c2c2b6e..2e98e6e 100644 --- a/templates/emails/modification-notification-mail.html.twig +++ b/templates/emails/modification-notification-mail.html.twig @@ -1,5 +1,4 @@ {#[Framadate] Participation au sondage : TESSSSSSSSSST#} -Quelqu'un vient de modifier votre sondage accessible au lien suivant https://framadate.org/NGutN7jB9vtoGOEjCfUJWBwr/admin. - -Merci de votre confiance. -Framadate +Quelqu'un vient de modifier votre sondage accessible au lien suivant: +
+{{ url }} diff --git a/templates/emails/owner-list.html.twig b/templates/emails/owner-list.html.twig index f1b44a0..db4ad4e 100644 --- a/templates/emails/owner-list.html.twig +++ b/templates/emails/owner-list.html.twig @@ -1,70 +1,74 @@ {#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#} -

+{% extends 'email-base.html.twig' %} +{% block content %} - Voici la liste des {{ polls|length }} sondages - - Framadate - - que vous avez créé. -

-
- Si vous n'avez pas demandé à recevoir cet email, veuillez en informer les administrateurs du site Framadate. -
-
- -{% include 'footer.html.twig' %} + +{% endblock %} From 3f2ac02b65c1086fcc31720cbc25935918301c6a Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Fri, 10 Apr 2020 17:21:31 +0200 Subject: [PATCH 02/12] :zap: send mail to owner added, return response 200 --- src/Controller/DefaultController.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 0412c62..5d0c23d 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -50,11 +50,18 @@ class DefaultController extends AbstractController { $templateVars ) ); + // send email $mailer->send( $message ); - return $this->render( 'emails/owner-list.html.twig', $templateVars ); + return $this->json( [ + 'message' => 'mail succefully sent to user ' . $email, + 'data' => '', + ], + 200 ); - } else { + + + } else { // user not found case return $this->json( [ 'message' => 'no user found for email ' . $email, 'data' => '', @@ -62,8 +69,8 @@ class DefaultController extends AbstractController { 400 ); } // find user by email - // send email - // user not found case + + } From c796db6d7c81caa1febbe47315130195a89215e5 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Fri, 10 Apr 2020 18:02:52 +0200 Subject: [PATCH 03/12] action de test pour template de mail --- src/Controller/DefaultController.php | 5 +- src/Controller/PollController.php | 50 ++++++++++++++++++- templates/emails/author-mail.html.twig | 5 +- templates/emails/creation-mail.html.twig | 27 ++++++++-- templates/emails/expiration-mail.html.twig | 5 ++ templates/emails/owner-list.html.twig | 49 +----------------- templates/emails/partial/admin_link.html.twig | 2 + templates/emails/partial/poll.html.twig | 39 +++++++++++++++ .../emails/partial/public_link.html.twig | 11 ++++ 9 files changed, 135 insertions(+), 58 deletions(-) create mode 100644 templates/emails/partial/admin_link.html.twig create mode 100644 templates/emails/partial/poll.html.twig create mode 100644 templates/emails/partial/public_link.html.twig diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 5d0c23d..2eb7664 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -31,6 +31,8 @@ class DefaultController extends AbstractController { */ public function sendPollsToUser( $email, \Swift_Mailer $mailer ) { $repository = $this->getDoctrine()->getRepository( Owner::class ); + + // find user by email $founduser = $repository->findOneBy( [ 'email' => $email ] ); if ( $founduser ) { @@ -68,9 +70,6 @@ class DefaultController extends AbstractController { ], 400 ); } - // find user by email - - } diff --git a/src/Controller/PollController.php b/src/Controller/PollController.php index 0180cbf..3114b33 100644 --- a/src/Controller/PollController.php +++ b/src/Controller/PollController.php @@ -11,6 +11,7 @@ use FOS\RestBundle\Controller\Annotations\Post; use FOS\RestBundle\Controller\Annotations\Put; use FOS\RestBundle\Controller\Annotations\Route; use JMS\Serializer\SerializerBuilder; +use Swift_Message; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -137,7 +138,7 @@ class PollController extends AbstractController { * * @return JsonResponse */ - public function newPollAction( Request $request ) { + public function newPollAction( Request $request, \Swift_Mailer $mailer ) { $data = $request->getContent(); @@ -225,6 +226,8 @@ class PollController extends AbstractController { $precision = 'from an existing user : ' . $foundOwner->getEmail(); } + $this->sendCreationMailAction( $foundOwner, $newpoll, $mailer ); + return $this->json( [ 'message' => 'you created a poll ' . $precision, 'poll' => $newpoll, @@ -237,6 +240,51 @@ class PollController extends AbstractController { } + /** + * @Get( + * path = "/mail/test-mail-poll", + * name = "test-mail-poll", + * ) + * + * send the creation mail to owner + * + * @param Owner $admin_user + * @param Poll $poll + * @param \Swift_Mailer $mailer + * + * @return int + */ +// public function sendCreationMailAction( Owner $admin_user, Poll $poll, \Swift_Mailer $mailer) { + public function sendCreationMailAction( \Swift_Mailer $mailer ) { + + $em = $this->getDoctrine()->getRepository( Owner::class ); + $admin_user = $em->find( 1 ); + $poll = $admin_user->getPolls()[ 0 ]; + + $templateVars = [ + 'owner' => $admin_user, + 'poll' => $poll, + 'url' => $poll->getCustomUrl(), + 'title' => 'Création de sondage - ' . $poll->getTitle(), + 'email_template' => 'emails/creation-mail.html.twig', + ]; + + $message = ( new Swift_Message( 'Framadate - mes sondages' ) ) + ->setFrom( 'ne-pas-repondre@framadate-api.cipherbliss.com' ) + ->setTo( $admin_user->getEmail() ) + ->setBody( + $this->renderView( + $templateVars[ 'email_template' ], + $templateVars + ) + ); + + // send email +// return $mailer->send( $message ); + return $this->render( $templateVars[ 'email_template' ], $templateVars ); + + } + /** * @Delete( diff --git a/templates/emails/author-mail.html.twig b/templates/emails/author-mail.html.twig index 4adec7e..3611148 100644 --- a/templates/emails/author-mail.html.twig +++ b/templates/emails/author-mail.html.twig @@ -3,13 +3,14 @@ Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur
Vous pouvez modifier ce sondage à l'adresse suivante :
-{{ url }} +{% include 'partial/admin_link.html.twig' %}
Pour partager votre sondage aux participants, utilisez son lien d'accès public.
-{% if is_password_protected %} +{% if poll.password %} Ce sondage est protégé par un mot de passe, n'oubliez pas de le communiquer à vos participants. + Vous pouvez changer ce mot de passe via l'administration. {% else %} {% endif %} diff --git a/templates/emails/creation-mail.html.twig b/templates/emails/creation-mail.html.twig index 2275545..d5d75d4 100644 --- a/templates/emails/creation-mail.html.twig +++ b/templates/emails/creation-mail.html.twig @@ -1,11 +1,28 @@ {#[Framadate][Pour diffusion aux sondés] Sondage: TESSSSSSSSSST#} -Ceci est le message qui doit être envoyé aux sondés.
+{% extends 'email-base.html.twig' %} +{% block content %} + + +Suite à la création de votre sondage {{ title }} vous recevez deux emails afin de ne pas transmettre par erreur aux sondés le lien d'administration de votre sondage. + Ce mail est le premier, comportant le message qui doit être envoyé aux sondés.
+ Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.
+
-hah vient de créer un sondage intitulé : "{{ title }}".
+
+ +
+ + + {{ owner.pseudo }} ( {{ owner.email }} ) vient de créer un sondage intitulé : " {{ title }}". +
+
Merci de bien vouloir participer au sondage à l'adresse suivante :
- - {{ url }} - +
+ {% include 'emails/partial/public_link.html.twig' %} +
+
+ +{% endblock %} diff --git a/templates/emails/expiration-mail.html.twig b/templates/emails/expiration-mail.html.twig index 468630f..b4bad72 100644 --- a/templates/emails/expiration-mail.html.twig +++ b/templates/emails/expiration-mail.html.twig @@ -1,5 +1,10 @@ {#[Framadate][expiration] Sondage: TESSSSSSSSSST#} +{% extends 'email-base.html.twig' %} +{% block content %} + + Ce sondage va bientôt expirer dans 1 jour, il ne sera plus possible d'y voter. Dans 31 jours il sera supprimé. Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer: {{ url }} +{% endblock %} diff --git a/templates/emails/owner-list.html.twig b/templates/emails/owner-list.html.twig index db4ad4e..77b1900 100644 --- a/templates/emails/owner-list.html.twig +++ b/templates/emails/owner-list.html.twig @@ -15,55 +15,10 @@
    - {% for p in polls %} + {% for poll in polls %}
  • - - {{ p.title }} - - - -
    -
    - créé le {{ p.creationDate| date('Y m d ') }} -
    -
    - expirera le {{ p.expiracyDate| date('Y m d ') }} -
    - - {{ p.stacksOfVotes |length }} votes - - - {{ p.comments |length }} commentaires - - {% if p.password |length %} - (accès avec mot de passe) - {% else %} - {% endif %} - -
    - -
    - - lien à donner aux votants: - - {% if p.customUrl |length %} - - {{ BASE_URL }}/poll/{{ p.customUrl }} - - {% else %} - - {{ BASE_URL }}/poll/{{ p.id }} - - {% endif %} -
    -
    - - administration: - - {{ BASE_URL }} - /admin/{{ p.adminKey }} -
    + {% include 'emails/partial/poll.html.twig' %}
  • diff --git a/templates/emails/partial/admin_link.html.twig b/templates/emails/partial/admin_link.html.twig new file mode 100644 index 0000000..5fd6b86 --- /dev/null +++ b/templates/emails/partial/admin_link.html.twig @@ -0,0 +1,2 @@ +{{ BASE_URL }} + /admin/{{ poll.adminKey }} diff --git a/templates/emails/partial/poll.html.twig b/templates/emails/partial/poll.html.twig new file mode 100644 index 0000000..a0243ac --- /dev/null +++ b/templates/emails/partial/poll.html.twig @@ -0,0 +1,39 @@ +
    +

    + Sondage {{ poll.title }} +

    + + +
    +
    + créé le {{ poll.creationDate| date('Y m d ') }} +
    +
    + expirera le {{ poll.expiracyDate| date('Y m d ') }} +
    + + {{ poll.stacksOfVotes |length }} votes + + + {{ poll.comments |length }} commentaires + + {% if poll.password |length %} + (accès avec mot de passe) + {% else %} + {% endif %} + +
    + +
    + + lien à donner aux votants: + + {% include 'public_link.html.twig' %} +
    +
    + + administration: + + {% include 'admin_link.html.twig' %} +
    +
    diff --git a/templates/emails/partial/public_link.html.twig b/templates/emails/partial/public_link.html.twig new file mode 100644 index 0000000..41114ce --- /dev/null +++ b/templates/emails/partial/public_link.html.twig @@ -0,0 +1,11 @@ + + {% if poll.customUrl |length %} + + {{ BASE_URL }}/#/vote/poll/key/{{ poll.customUrl }} + + {% else %} + + {{ BASE_URL }}/#/vote/poll/id/{{ poll.id }} + + {% endif %} + From aa06af19c37bf8583267c62ecde5d7658c317c86 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 16:25:54 +0200 Subject: [PATCH 04/12] hop --- templates/emails/creation-mail.html.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/emails/creation-mail.html.twig b/templates/emails/creation-mail.html.twig index d5d75d4..17d2ff3 100644 --- a/templates/emails/creation-mail.html.twig +++ b/templates/emails/creation-mail.html.twig @@ -4,6 +4,7 @@ Suite à la création de votre sondage {{ title }} vous recevez deux emails afin de ne pas transmettre par erreur aux sondés le lien d'administration de votre sondage. +
    Ce mail est le premier, comportant le message qui doit être envoyé aux sondés.
    Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.
    From da39373a983dd10477838523b7c7a11cad0f3502 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 17:28:30 +0200 Subject: [PATCH 05/12] :zap: mail having containers --- src/Controller/PollController.php | 41 +++++++-------- src/Service/MailService.php | 52 +++++++++++++++++++ templates/emails/author-mail.html.twig | 17 ++++-- .../comment-notification-mail.html.twig | 4 -- .../emails/comment-notification.html.twig | 21 ++++++++ templates/emails/expiration-mail.html.twig | 2 +- .../modification-notification-mail.html.twig | 8 ++- templates/emails/owner-list.html.twig | 3 -- templates/emails/partial/poll.html.twig | 4 +- 9 files changed, 113 insertions(+), 39 deletions(-) create mode 100644 src/Service/MailService.php delete mode 100644 templates/emails/comment-notification-mail.html.twig create mode 100644 templates/emails/comment-notification.html.twig diff --git a/src/Controller/PollController.php b/src/Controller/PollController.php index 3114b33..7237064 100644 --- a/src/Controller/PollController.php +++ b/src/Controller/PollController.php @@ -5,13 +5,13 @@ namespace App\Controller; use App\Entity\Choice; use App\Entity\Owner; use App\Entity\Poll; +use App\Service\MailService; use FOS\RestBundle\Controller\Annotations\Delete; use FOS\RestBundle\Controller\Annotations\Get; use FOS\RestBundle\Controller\Annotations\Post; use FOS\RestBundle\Controller\Annotations\Put; use FOS\RestBundle\Controller\Annotations\Route; use JMS\Serializer\SerializerBuilder; -use Swift_Message; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -138,7 +138,7 @@ class PollController extends AbstractController { * * @return JsonResponse */ - public function newPollAction( Request $request, \Swift_Mailer $mailer ) { + public function newPollAction( Request $request, \Swift_Mailer $mailer, MailService $mail_service ) { $data = $request->getContent(); @@ -226,7 +226,7 @@ class PollController extends AbstractController { $precision = 'from an existing user : ' . $foundOwner->getEmail(); } - $this->sendCreationMailAction( $foundOwner, $newpoll, $mailer ); + $mail_service->sendCreationMailAction( $foundOwner, $newpoll ); return $this->json( [ 'message' => 'you created a poll ' . $precision, @@ -242,7 +242,7 @@ class PollController extends AbstractController { /** * @Get( - * path = "/mail/test-mail-poll", + * path = "/mail/test-mail-poll/{emailChoice}", * name = "test-mail-poll", * ) * @@ -255,34 +255,29 @@ class PollController extends AbstractController { * @return int */ // public function sendCreationMailAction( Owner $admin_user, Poll $poll, \Swift_Mailer $mailer) { - public function sendCreationMailAction( \Swift_Mailer $mailer ) { - + public function testSendCreationMailAction( MailService $mail_service, $emailChoice = 'creation_comment' ) { $em = $this->getDoctrine()->getRepository( Owner::class ); - $admin_user = $em->find( 1 ); - $poll = $admin_user->getPolls()[ 0 ]; + $foundOwner = $em->find( 1 ); + $poll = $foundOwner->getPolls()[ 0 ]; + $comment = $foundOwner->getComments()[ 0 ]; + + $emailChoicesTemplates = [ + 'creation_poll' => 'creation-mail.html.twig', + 'creation_comment' => 'comment-notification.html.twig', + ]; + +// $mail_service->sendCreationMailAction( $foundOwner, $poll ); $templateVars = [ - 'owner' => $admin_user, + 'owner' => $foundOwner, + 'comment' => $comment, 'poll' => $poll, 'url' => $poll->getCustomUrl(), 'title' => 'Création de sondage - ' . $poll->getTitle(), - 'email_template' => 'emails/creation-mail.html.twig', + 'email_template' => 'emails/' . $emailChoicesTemplates[ $emailChoice ], ]; - $message = ( new Swift_Message( 'Framadate - mes sondages' ) ) - ->setFrom( 'ne-pas-repondre@framadate-api.cipherbliss.com' ) - ->setTo( $admin_user->getEmail() ) - ->setBody( - $this->renderView( - $templateVars[ 'email_template' ], - $templateVars - ) - ); - - // send email -// return $mailer->send( $message ); return $this->render( $templateVars[ 'email_template' ], $templateVars ); - } diff --git a/src/Service/MailService.php b/src/Service/MailService.php new file mode 100644 index 0000000..eb229aa --- /dev/null +++ b/src/Service/MailService.php @@ -0,0 +1,52 @@ +getDoctrine()->getRepository( Owner::class ); + $admin_user = $em->find( 1 ); + $poll = $admin_user->getPolls()[ 0 ]; + + + // anti spam , limit to every minute + $lastSend = $admin_user->getRequestedPollsDate(); + $now = new \DateTime(); + + if ( date_diff( $lastSend, $now ) < 60 ) { + // too soon! + die( 'too soon!' ); + } + $admin_user->setRequestedPollsDate( $now ); + $em->persist( $admin_user ); + $em->flush(); + + $templateVars = [ + 'owner' => $admin_user, + 'poll' => $poll, + 'url' => $poll->getCustomUrl(), + 'title' => 'Création de sondage - ' . $poll->getTitle(), + 'email_template' => 'emails/creation-mail.html.twig', + ]; + + $message = ( new Swift_Message( 'Framadate - mes sondages' ) ) + ->setFrom( 'ne-pas-repondre@framadate-api.cipherbliss.com' ) + ->setTo( $admin_user->getEmail() ) + ->setBody( + $this->renderView( + $templateVars[ 'email_template' ], + $templateVars + ) + ); + + // send email + return $mailer->send( $message ); + + } +} diff --git a/templates/emails/author-mail.html.twig b/templates/emails/author-mail.html.twig index 3611148..d97b292 100644 --- a/templates/emails/author-mail.html.twig +++ b/templates/emails/author-mail.html.twig @@ -1,11 +1,18 @@ {#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#} -Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage. +{% extends 'email-base.html.twig' %} +{% block content %} +

    + + Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage. +


    -Vous pouvez modifier ce sondage à l'adresse suivante : +

    + Vous pouvez modifier ce sondage à l'adresse suivante : +


    -{% include 'partial/admin_link.html.twig' %} +{% include 'emails/partial/admin_link.html.twig' %}
    -Pour partager votre sondage aux participants, utilisez son lien d'accès public. +Pour partager votre sondage aux participants, utilisez son lien d'accès public que vous avez reçu dans un autre email.
    {% if poll.password %} @@ -14,3 +21,5 @@ Pour partager votre sondage aux participants, utilisez son lien d'accès public. {% else %} {% endif %} + +{% endblock %} diff --git a/templates/emails/comment-notification-mail.html.twig b/templates/emails/comment-notification-mail.html.twig deleted file mode 100644 index e974021..0000000 --- a/templates/emails/comment-notification-mail.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{#[Framadate] Notification d'un sondage : TESSSSSSSSSST#} -{{ pseudo }} vient de rédiger un commentaire. -
    -Vous pouvez retrouver votre sondage avec le lien suivant : {{ url }} diff --git a/templates/emails/comment-notification.html.twig b/templates/emails/comment-notification.html.twig new file mode 100644 index 0000000..51aa816 --- /dev/null +++ b/templates/emails/comment-notification.html.twig @@ -0,0 +1,21 @@ +{#[Framadate] Notification d'un sondage : TESSSSSSSSSST#} +{% extends 'email-base.html.twig' %} +{% block content %} + + {{ owner.pseudo }} + + vient de rédiger un commentaire. +
    + + + {% autoescape %} + {{ comment.text }} + {% endautoescape %} + +
    +
    + Vous pouvez retrouver votre sondage avec le lien suivant : + {% include 'emails/partial/admin_link.html.twig' %} + {% include 'emails/partial/public_link.html.twig' %} + +{% endblock %} diff --git a/templates/emails/expiration-mail.html.twig b/templates/emails/expiration-mail.html.twig index b4bad72..70634c6 100644 --- a/templates/emails/expiration-mail.html.twig +++ b/templates/emails/expiration-mail.html.twig @@ -6,5 +6,5 @@ Ce sondage va bientôt expirer dans 1 jour, il ne sera plus possible d'y voter. Dans 31 jours il sera supprimé. Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer: -{{ url }} + {% include 'emails/partial/admin_link.html.twig' %} {% endblock %} diff --git a/templates/emails/modification-notification-mail.html.twig b/templates/emails/modification-notification-mail.html.twig index 2e98e6e..797eb46 100644 --- a/templates/emails/modification-notification-mail.html.twig +++ b/templates/emails/modification-notification-mail.html.twig @@ -1,4 +1,8 @@ {#[Framadate] Participation au sondage : TESSSSSSSSSST#} -Quelqu'un vient de modifier votre sondage accessible au lien suivant: +{% extends 'email-base.html.twig' %} +{% block content %} + Quelqu'un vient de modifier votre sondage accessible au lien suivant:
    -{{ url }} + {% include 'emails/partial/admin_link.html.twig' %} + +{% endblock %} diff --git a/templates/emails/owner-list.html.twig b/templates/emails/owner-list.html.twig index 77b1900..1fec181 100644 --- a/templates/emails/owner-list.html.twig +++ b/templates/emails/owner-list.html.twig @@ -17,10 +17,7 @@
      {% for poll in polls %}
    • - {% include 'emails/partial/poll.html.twig' %} - -
    • {% endfor %}
    diff --git a/templates/emails/partial/poll.html.twig b/templates/emails/partial/poll.html.twig index a0243ac..347ca45 100644 --- a/templates/emails/partial/poll.html.twig +++ b/templates/emails/partial/poll.html.twig @@ -28,12 +28,12 @@ lien à donner aux votants: - {% include 'public_link.html.twig' %} + {% include 'emails/partial/public_link.html.twig' %}
    administration: - {% include 'admin_link.html.twig' %} + {% include 'emails/partial/admin_link.html.twig' %}
    From 99f1584d24ad704979a17d1915ac409ff6494c72 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 17:35:45 +0200 Subject: [PATCH 06/12] :zap: rearrange templates --- templates/emails/author-mail.html.twig | 36 +++++++++---------- templates/emails/creation-mail.html.twig | 25 ++++++------- templates/emails/expiration-mail.html.twig | 4 +-- templates/emails/footer.html.twig | 4 +-- .../modification-notification-mail.html.twig | 2 +- templates/emails/partial/poll.html.twig | 2 +- 6 files changed, 37 insertions(+), 36 deletions(-) diff --git a/templates/emails/author-mail.html.twig b/templates/emails/author-mail.html.twig index d97b292..9a154ed 100644 --- a/templates/emails/author-mail.html.twig +++ b/templates/emails/author-mail.html.twig @@ -1,25 +1,25 @@ {#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#} {% extends 'email-base.html.twig' %} {% block content %} -

    +

    - Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage. -

    -
    -

    - Vous pouvez modifier ce sondage à l'adresse suivante : -

    -
    -{% include 'emails/partial/admin_link.html.twig' %} -
    -Pour partager votre sondage aux participants, utilisez son lien d'accès public que vous avez reçu dans un autre email. -
    + Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage. + +
    +

    + Vous pouvez modifier ce sondage à l'adresse suivante : +

    +
    + {% include 'emails/partial/admin_link.html.twig' %} +
    + Pour partager votre sondage aux participants, utilisez son lien d'accès public que vous avez reçu dans un autre email. +
    -{% if poll.password %} - Ce sondage est protégé par un mot de passe, n'oubliez pas de le communiquer à vos participants. - Vous pouvez changer ce mot de passe via l'administration. -{% else %} + {% if poll.password %} + Ce sondage est protégé par un mot de passe, n'oubliez pas de le communiquer à vos participants. + Vous pouvez changer ce mot de passe via l'administration. + {% else %} -{% endif %} + {% endif %} -{% endblock %} +{% endblock %} diff --git a/templates/emails/creation-mail.html.twig b/templates/emails/creation-mail.html.twig index 17d2ff3..081beef 100644 --- a/templates/emails/creation-mail.html.twig +++ b/templates/emails/creation-mail.html.twig @@ -3,27 +3,28 @@ {% block content %} -Suite à la création de votre sondage {{ title }} vous recevez deux emails afin de ne pas transmettre par erreur aux sondés le lien d'administration de votre sondage. + Suite à la création de votre sondage {{ title }} vous recevez deux emails afin de ne pas transmettre par erreur aux sondés le lien d'administration de votre sondage.
    Ce mail est le premier, comportant le message qui doit être envoyé aux sondés.
    -Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.
    + Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.
    -
    +
    -
    - +
    + - {{ owner.pseudo }} ( {{ owner.email }} ) vient de créer un sondage intitulé : " {{ title }}". -
    -
    -Merci de bien vouloir participer au sondage à l'adresse suivante :
    + {{ owner.pseudo }} ( {{ owner.email }} ) vient de créer un sondage intitulé : " {{ title }} + ". +
    +
    + Merci de bien vouloir participer au sondage à l'adresse suivante :
    -
    - {% include 'emails/partial/public_link.html.twig' %} +
    + {% include 'emails/partial/public_link.html.twig' %} -
    +
    {% endblock %} diff --git a/templates/emails/expiration-mail.html.twig b/templates/emails/expiration-mail.html.twig index 70634c6..fb8b4cf 100644 --- a/templates/emails/expiration-mail.html.twig +++ b/templates/emails/expiration-mail.html.twig @@ -3,8 +3,8 @@ {% block content %} -Ce sondage va bientôt expirer dans 1 jour, il ne sera plus possible d'y voter. -Dans 31 jours il sera supprimé. Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer: + Ce sondage va bientôt expirer dans 1 jour, il ne sera plus possible d'y voter. + Dans 31 jours il sera supprimé. Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer: {% include 'emails/partial/admin_link.html.twig' %} {% endblock %} diff --git a/templates/emails/footer.html.twig b/templates/emails/footer.html.twig index 3438b32..c23c539 100644 --- a/templates/emails/footer.html.twig +++ b/templates/emails/footer.html.twig @@ -11,10 +11,10 @@
    - Sources du client Front end, + Sources du client Front end, - API back end. + API back end. diff --git a/templates/emails/modification-notification-mail.html.twig b/templates/emails/modification-notification-mail.html.twig index 797eb46..846ee98 100644 --- a/templates/emails/modification-notification-mail.html.twig +++ b/templates/emails/modification-notification-mail.html.twig @@ -2,7 +2,7 @@ {% extends 'email-base.html.twig' %} {% block content %} Quelqu'un vient de modifier votre sondage accessible au lien suivant: -
    +
    {% include 'emails/partial/admin_link.html.twig' %} {% endblock %} diff --git a/templates/emails/partial/poll.html.twig b/templates/emails/partial/poll.html.twig index 347ca45..764aa70 100644 --- a/templates/emails/partial/poll.html.twig +++ b/templates/emails/partial/poll.html.twig @@ -1,6 +1,6 @@

    - Sondage {{ poll.title }} + Sondage {{ poll.title }}

    From 1e9c5074b2e6a3eeb433f7cdc182352232f712fa Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 17:35:57 +0200 Subject: [PATCH 07/12] :zap: mail service start --- src/Service/MailService.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Service/MailService.php b/src/Service/MailService.php index eb229aa..698b15d 100644 --- a/src/Service/MailService.php +++ b/src/Service/MailService.php @@ -5,14 +5,22 @@ namespace App\Service; use App\Entity\Owner; +use App\Entity\Poll; +use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; +use Swift_Message; class MailService { - public function sendCreationMailAction( $foundOwner, $newpoll, \Swift_Mailer $mailer ) { - $em = $this->getDoctrine()->getRepository( Owner::class ); - $admin_user = $em->find( 1 ); - $poll = $admin_user->getPolls()[ 0 ]; + public function __construct(EntityManagerInterface $entityManager) { + $this->em = $entityManager; + } + + public function sendCreationMailAction( Owner $foundOwner, Poll $newpoll, \Swift_Mailer $mailer ) { + $em = $this->em->getRepository( Owner::class ); + $admin_user = $foundOwner; + $poll = $newpoll; // anti spam , limit to every minute @@ -30,7 +38,6 @@ class MailService { $templateVars = [ 'owner' => $admin_user, 'poll' => $poll, - 'url' => $poll->getCustomUrl(), 'title' => 'Création de sondage - ' . $poll->getTitle(), 'email_template' => 'emails/creation-mail.html.twig', ]; From ca7dcceda7d58e95f251c1e971cbd88a6b9c3329 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 17:41:06 +0200 Subject: [PATCH 08/12] :zap: test templates --- src/Controller/PollController.php | 9 +++++++-- templates/emails/vote-notification.html.twig | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 templates/emails/vote-notification.html.twig diff --git a/src/Controller/PollController.php b/src/Controller/PollController.php index 7237064..a177ad0 100644 --- a/src/Controller/PollController.php +++ b/src/Controller/PollController.php @@ -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 ); diff --git a/templates/emails/vote-notification.html.twig b/templates/emails/vote-notification.html.twig new file mode 100644 index 0000000..afaf090 --- /dev/null +++ b/templates/emails/vote-notification.html.twig @@ -0,0 +1,15 @@ +{#[Framadate] Notification d'un sondage : TESSSSSSSSSST#} +{% extends 'email-base.html.twig' %} +{% block content %} + + {{ owner.pseudo }} + + vient de voter au sondage. + + {{ owner.votes |length }} +
    + Vous pouvez retrouver votre sondage avec le lien suivant : + {% include 'emails/partial/admin_link.html.twig' %} + {% include 'emails/partial/public_link.html.twig' %} + +{% endblock %} From 7c9b97ac58cfd02f9d516ffbd608fbddc84ba79e Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 17:50:25 +0200 Subject: [PATCH 09/12] more emails --- src/Controller/PollController.php | 14 ++++++++++---- templates/email-base.html.twig | 12 ++++++++++++ templates/emails/vote-notification.html.twig | 2 -- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Controller/PollController.php b/src/Controller/PollController.php index a177ad0..c66f387 100644 --- a/src/Controller/PollController.php +++ b/src/Controller/PollController.php @@ -255,7 +255,7 @@ class PollController extends AbstractController { * @return int */ // 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 ); $foundOwner = $em->find( 1 ); $poll = $foundOwner->getPolls()[ 0 ]; @@ -264,13 +264,19 @@ class PollController extends AbstractController { $emailChoicesTemplates = [ '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_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(), + 'creation_poll' => 'Framadate | Création de sondage - lien public - ' . $poll->getTitle(), + 'creation_poll_admin' => 'Framadate | Création de sondage - lien admin - ', + '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 ); diff --git a/templates/email-base.html.twig b/templates/email-base.html.twig index 2965a4a..dcce573 100644 --- a/templates/email-base.html.twig +++ b/templates/email-base.html.twig @@ -8,11 +8,22 @@ padding: 1em; } .footer-content{ + margin-top: 1em; background: #ccc; } ul { 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; + }
    {% block title %} @@ -23,6 +34,7 @@ {% endif %}
    {% endblock %} + {% block stylesheets %}{% endblock %}
    diff --git a/templates/emails/vote-notification.html.twig b/templates/emails/vote-notification.html.twig index afaf090..b1b174d 100644 --- a/templates/emails/vote-notification.html.twig +++ b/templates/emails/vote-notification.html.twig @@ -5,8 +5,6 @@ {{ owner.pseudo }} vient de voter au sondage. - - {{ owner.votes |length }}
    Vous pouvez retrouver votre sondage avec le lien suivant : {% include 'emails/partial/admin_link.html.twig' %} From c133b1af99371cac080c338485a7d29d27c2ba6c Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 18:04:10 +0200 Subject: [PATCH 10/12] :zap: test all emails --- .env | 2 ++ src/Controller/PollController.php | 4 +++- templates/emails/expiration-mail.html.twig | 11 ++++++++--- templates/emails/footer.html.twig | 4 ++++ .../emails/modification-notification-mail.html.twig | 9 ++++++++- templates/emails/owner-list.html.twig | 4 ++-- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 71d04a1..e3e6904 100644 --- a/.env +++ b/.env @@ -39,4 +39,6 @@ CORS_ALLOW_ORIGIN=^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$ # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" # Delivery is disabled by default via "null://localhost" MAILER_URL=null://localhost +# set the support email who will answer users in case of emergency +SUPPORT_EMAIL=admin_framadate@yopmail.com ###< symfony/swiftmailer-bundle ### diff --git a/src/Controller/PollController.php b/src/Controller/PollController.php index c66f387..2126d49 100644 --- a/src/Controller/PollController.php +++ b/src/Controller/PollController.php @@ -255,7 +255,7 @@ class PollController extends AbstractController { * @return int */ // public function sendCreationMailAction( Owner $admin_user, Poll $poll, \Swift_Mailer $mailer) { - public function testSendCreationMailAction( MailService $mail_service, $emailChoice = 'creation_poll_admin' ) { + public function testSendCreationMailAction( MailService $mail_service, $emailChoice = 'creation_vote' ) { $em = $this->getDoctrine()->getRepository( Owner::class ); $foundOwner = $em->find( 1 ); $poll = $foundOwner->getPolls()[ 0 ]; @@ -264,6 +264,7 @@ class PollController extends AbstractController { $emailChoicesTemplates = [ 'creation_poll' => 'creation-mail.html.twig', + 'edit_poll' => 'modification-notification-mail.html.twig', 'creation_poll_admin' => 'author-mail.html.twig', 'owner_list' => 'owner-list.html.twig', 'expiration' => 'expiration-mail.html.twig', @@ -272,6 +273,7 @@ class PollController extends AbstractController { ]; $emailChoicesTitles = [ 'creation_poll' => 'Framadate | Création de sondage - lien public - ' . $poll->getTitle(), + 'edit_poll' => 'Framadate | Modification de sondage - ' . $poll->getTitle(), 'creation_poll_admin' => 'Framadate | Création de sondage - lien admin - ', 'owner_list' => 'Framadate | Vos sondages créés', 'expiration' => 'Framadate | Notice d\'expiration du sondage '. $poll->getTitle(), diff --git a/templates/emails/expiration-mail.html.twig b/templates/emails/expiration-mail.html.twig index fb8b4cf..49adf56 100644 --- a/templates/emails/expiration-mail.html.twig +++ b/templates/emails/expiration-mail.html.twig @@ -3,8 +3,13 @@ {% block content %} - Ce sondage va bientôt expirer dans 1 jour, il ne sera plus possible d'y voter. - Dans 31 jours il sera supprimé. Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer: - + Ce sondage va bientôt expirer dans 1 jour,
    +
    + le {{ poll.expiracyDate | date('D Y-m-d') }} +
    + il ne sera plus possible d'y voter.
    + Dans 31 jours il sera supprimé.
    + Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer: +
    {% include 'emails/partial/admin_link.html.twig' %} {% endblock %} diff --git a/templates/emails/footer.html.twig b/templates/emails/footer.html.twig index c23c539..bb67a38 100644 --- a/templates/emails/footer.html.twig +++ b/templates/emails/footer.html.twig @@ -16,5 +16,9 @@ API back end. + + Documentation + +
    diff --git a/templates/emails/modification-notification-mail.html.twig b/templates/emails/modification-notification-mail.html.twig index 846ee98..d1b6728 100644 --- a/templates/emails/modification-notification-mail.html.twig +++ b/templates/emails/modification-notification-mail.html.twig @@ -1,8 +1,15 @@ {#[Framadate] Participation au sondage : TESSSSSSSSSST#} {% extends 'email-base.html.twig' %} {% block content %} - Quelqu'un vient de modifier votre sondage accessible au lien suivant: + + {{ poll.owner.pseudo }} , + {{ poll.owner.email }} , + vient de modifier votre sondage accessible au lien suivant:
    {% include 'emails/partial/admin_link.html.twig' %} +
    + lien public: +
    + {% include 'emails/partial/public_link.html.twig' %} {% endblock %} diff --git a/templates/emails/owner-list.html.twig b/templates/emails/owner-list.html.twig index 1fec181..2a9a868 100644 --- a/templates/emails/owner-list.html.twig +++ b/templates/emails/owner-list.html.twig @@ -4,7 +4,7 @@

    - Voici la liste des {{ polls|length }} sondages + Voici la liste des {{ owner.polls|length }} sondages Framadate @@ -15,7 +15,7 @@
      - {% for poll in polls %} + {% for poll in owner.polls %}
    • {% include 'emails/partial/poll.html.twig' %}
    • From f40b899ac823622ca4898ab9da0eaa82b3b11701 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 18:09:45 +0200 Subject: [PATCH 11/12] link with hash --- templates/email-base.html.twig | 6 +++--- templates/emails/comment-notification.html.twig | 3 ++- templates/emails/partial/admin_link.html.twig | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/templates/email-base.html.twig b/templates/email-base.html.twig index dcce573..d61d744 100644 --- a/templates/email-base.html.twig +++ b/templates/email-base.html.twig @@ -9,14 +9,14 @@ } .footer-content{ margin-top: 1em; - background: #ccc; + background: #f2dff2; } ul { - border-left: 3px solid #ddd; + border-left: 3px solid #f2dff2; } a { padding: 1em; border-radius: 3px; - background: #7d6c99; + background: #ceb4f5; color: #201b27; margin: 0.5rem 0; display: inline-block; diff --git a/templates/emails/comment-notification.html.twig b/templates/emails/comment-notification.html.twig index 51aa816..579ffd3 100644 --- a/templates/emails/comment-notification.html.twig +++ b/templates/emails/comment-notification.html.twig @@ -7,7 +7,6 @@ vient de rédiger un commentaire.
      - {% autoescape %} {{ comment.text }} {% endautoescape %} @@ -15,7 +14,9 @@

      Vous pouvez retrouver votre sondage avec le lien suivant : +
      {% include 'emails/partial/admin_link.html.twig' %} +
      {% include 'emails/partial/public_link.html.twig' %} {% endblock %} diff --git a/templates/emails/partial/admin_link.html.twig b/templates/emails/partial/admin_link.html.twig index 5fd6b86..9743509 100644 --- a/templates/emails/partial/admin_link.html.twig +++ b/templates/emails/partial/admin_link.html.twig @@ -1,2 +1,2 @@ -{{ BASE_URL }} +{{ BASE_URL }} /admin/{{ poll.adminKey }} From 6e90c50aa5d64928359d4dc0cb2abf405ae1004f Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Sun, 12 Apr 2020 18:15:58 +0200 Subject: [PATCH 12/12] ignore front end stuff --- .gitignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index 616410a..416a4d1 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,18 @@ ###> symfony/web-server-bundle ### /.web-server-pid ###< symfony/web-server-bundle ### + +# framdate front end funky repository +public/3rdpartylicenses.txt +public/assets/i18n/en.json +public/assets/i18n/fr.json +public/assets/scss/atoms/_buttons.scss +public/assets/scss/atoms/_main.scss +public/assets/scss/useful_classes.scss +public/framadate-scripts-bundled.js +public/main-es2018.js +public/main-es5.js +public/polyfills-es2018.js +public/polyfills-es5.js +public/scripts.js +public/styles.css