mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
Merge branch 'master' of https://framagit.org/tykayn/date-poll-api
This commit is contained in:
commit
a90fe5dd1a
2
.env
2
.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="
|
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
|
||||||
# Delivery is disabled by default via "null://localhost"
|
# Delivery is disabled by default via "null://localhost"
|
||||||
MAILER_URL=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 ###
|
###< symfony/swiftmailer-bundle ###
|
||||||
|
15
.gitignore
vendored
15
.gitignore
vendored
@ -14,3 +14,18 @@
|
|||||||
###> symfony/web-server-bundle ###
|
###> symfony/web-server-bundle ###
|
||||||
/.web-server-pid
|
/.web-server-pid
|
||||||
###< symfony/web-server-bundle ###
|
###< 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
|
||||||
|
@ -31,6 +31,8 @@ class DefaultController extends AbstractController {
|
|||||||
*/
|
*/
|
||||||
public function sendPollsToUser( $email, \Swift_Mailer $mailer ) {
|
public function sendPollsToUser( $email, \Swift_Mailer $mailer ) {
|
||||||
$repository = $this->getDoctrine()->getRepository( Owner::class );
|
$repository = $this->getDoctrine()->getRepository( Owner::class );
|
||||||
|
|
||||||
|
// find user by email
|
||||||
$founduser = $repository->findOneBy( [ 'email' => $email ] );
|
$founduser = $repository->findOneBy( [ 'email' => $email ] );
|
||||||
|
|
||||||
if ( $founduser ) {
|
if ( $founduser ) {
|
||||||
@ -38,6 +40,7 @@ class DefaultController extends AbstractController {
|
|||||||
$templateVars = [
|
$templateVars = [
|
||||||
'owner' => $founduser,
|
'owner' => $founduser,
|
||||||
'polls' => $polls,
|
'polls' => $polls,
|
||||||
|
'title' => 'Mes sondages - '.$email,
|
||||||
];
|
];
|
||||||
|
|
||||||
$message = ( new Swift_Message( 'Framadate - mes sondages' ) )
|
$message = ( new Swift_Message( 'Framadate - mes sondages' ) )
|
||||||
@ -49,20 +52,24 @@ class DefaultController extends AbstractController {
|
|||||||
$templateVars
|
$templateVars
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
// send email
|
||||||
$mailer->send( $message );
|
$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( [
|
return $this->json( [
|
||||||
'message' => 'no user found for email ' . $email,
|
'message' => 'no user found for email ' . $email,
|
||||||
'data' => '',
|
'data' => '',
|
||||||
],
|
],
|
||||||
400 );
|
400 );
|
||||||
}
|
}
|
||||||
// find user by email
|
|
||||||
// send email
|
|
||||||
// user not found case
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ namespace App\Controller;
|
|||||||
use App\Entity\Choice;
|
use App\Entity\Choice;
|
||||||
use App\Entity\Owner;
|
use App\Entity\Owner;
|
||||||
use App\Entity\Poll;
|
use App\Entity\Poll;
|
||||||
|
use App\Service\MailService;
|
||||||
use FOS\RestBundle\Controller\Annotations\Delete;
|
use FOS\RestBundle\Controller\Annotations\Delete;
|
||||||
use FOS\RestBundle\Controller\Annotations\Get;
|
use FOS\RestBundle\Controller\Annotations\Get;
|
||||||
use FOS\RestBundle\Controller\Annotations\Post;
|
use FOS\RestBundle\Controller\Annotations\Post;
|
||||||
@ -137,7 +138,7 @@ class PollController extends AbstractController {
|
|||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function newPollAction( Request $request ) {
|
public function newPollAction( Request $request, \Swift_Mailer $mailer, MailService $mail_service ) {
|
||||||
|
|
||||||
$data = $request->getContent();
|
$data = $request->getContent();
|
||||||
|
|
||||||
@ -225,6 +226,8 @@ class PollController extends AbstractController {
|
|||||||
$precision = 'from an existing user : ' . $foundOwner->getEmail();
|
$precision = 'from an existing user : ' . $foundOwner->getEmail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mail_service->sendCreationMailAction( $foundOwner, $newpoll );
|
||||||
|
|
||||||
return $this->json( [
|
return $this->json( [
|
||||||
'message' => 'you created a poll ' . $precision,
|
'message' => 'you created a poll ' . $precision,
|
||||||
'poll' => $newpoll,
|
'poll' => $newpoll,
|
||||||
@ -237,6 +240,59 @@ class PollController extends AbstractController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Get(
|
||||||
|
* path = "/mail/test-mail-poll/{emailChoice}",
|
||||||
|
* 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 testSendCreationMailAction( MailService $mail_service, $emailChoice = 'creation_vote' ) {
|
||||||
|
$em = $this->getDoctrine()->getRepository( Owner::class );
|
||||||
|
$foundOwner = $em->find( 1 );
|
||||||
|
$poll = $foundOwner->getPolls()[ 0 ];
|
||||||
|
$comment = $foundOwner->getComments()[ 0 ];
|
||||||
|
|
||||||
|
|
||||||
|
$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',
|
||||||
|
'creation_comment' => 'comment-notification.html.twig',
|
||||||
|
'creation_vote' => 'vote-notification.html.twig',
|
||||||
|
];
|
||||||
|
$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(),
|
||||||
|
'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 );
|
||||||
|
$templateVars = [
|
||||||
|
'owner' => $foundOwner,
|
||||||
|
'comment' => $comment,
|
||||||
|
'poll' => $poll,
|
||||||
|
'email_template' => 'emails/' . $emailChoicesTemplates[ $emailChoice ],
|
||||||
|
'title' => $emailChoicesTitles[ $emailChoice ],
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this->render( $templateVars[ 'email_template' ], $templateVars );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Delete(
|
* @Delete(
|
||||||
|
59
src/Service/MailService.php
Normal file
59
src/Service/MailService.php
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
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 __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
|
||||||
|
$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,
|
||||||
|
'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 );
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
<title>{% block title %}Framdate{% endblock %}</title>
|
||||||
{% block stylesheets %}{% endblock %}
|
{% block stylesheets %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
50
templates/email-base.html.twig
Normal file
50
templates/email-base.html.twig
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<div class="email">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
html, body, main, header, footer, div {
|
||||||
|
font-family: "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
|
}
|
||||||
|
.email{
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
.footer-content{
|
||||||
|
margin-top: 1em;
|
||||||
|
background: #f2dff2;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
border-left: 3px solid #f2dff2;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
padding: 1em; border-radius: 3px;
|
||||||
|
background: #ceb4f5;
|
||||||
|
color: #201b27;
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
h1,h2,h3{
|
||||||
|
color: #3c334a;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<header>
|
||||||
|
{% block title %}
|
||||||
|
{% if title is defined %}
|
||||||
|
<h1>{{ title }}</h1>
|
||||||
|
{% else %}
|
||||||
|
<h1>Framadate - email</h1>
|
||||||
|
{% endif %}
|
||||||
|
<hr>
|
||||||
|
{% endblock %}
|
||||||
|
{% block stylesheets %}{% endblock %}
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
{% block footer %}
|
||||||
|
{% include 'emails/footer.html.twig' %}
|
||||||
|
{% endblock %}
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
@ -1,9 +1,25 @@
|
|||||||
{#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#}
|
{#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#}
|
||||||
|
{% extends 'email-base.html.twig' %}
|
||||||
|
{% block content %}
|
||||||
|
<h1>
|
||||||
|
|
||||||
Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage.
|
Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage.
|
||||||
|
</h1>
|
||||||
|
<br>
|
||||||
|
<h2>
|
||||||
Vous pouvez modifier ce sondage à l'adresse suivante :
|
Vous pouvez modifier ce sondage à l'adresse suivante :
|
||||||
|
</h2>
|
||||||
|
<br>
|
||||||
|
{% include 'emails/partial/admin_link.html.twig' %}
|
||||||
|
<br>
|
||||||
|
Pour partager votre sondage aux participants, utilisez son lien d'accès public que vous avez reçu dans un autre email.
|
||||||
|
<br>
|
||||||
|
|
||||||
https://framadate.org/NGutN7jB9vtoGOEjCfUJWBwr/admin
|
{% 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 %}
|
||||||
|
|
||||||
Merci de votre confiance.
|
{% endif %}
|
||||||
Framadate
|
|
||||||
|
{% endblock %}
|
||||||
|
22
templates/emails/comment-notification.html.twig
Normal file
22
templates/emails/comment-notification.html.twig
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{#[Framadate] Notification d'un sondage : TESSSSSSSSSST#}
|
||||||
|
{% extends 'email-base.html.twig' %}
|
||||||
|
{% block content %}
|
||||||
|
<strong>
|
||||||
|
{{ owner.pseudo }}
|
||||||
|
</strong>
|
||||||
|
vient de rédiger un commentaire.
|
||||||
|
<blockquote style="background: #dedede; padding: 1em 2em;">
|
||||||
|
<i>
|
||||||
|
{% autoescape %}
|
||||||
|
{{ comment.text }}
|
||||||
|
{% endautoescape %}
|
||||||
|
</i>
|
||||||
|
</blockquote>
|
||||||
|
<br>
|
||||||
|
Vous pouvez retrouver votre sondage avec le lien suivant :
|
||||||
|
<br>
|
||||||
|
{% include 'emails/partial/admin_link.html.twig' %}
|
||||||
|
<br>
|
||||||
|
{% include 'emails/partial/public_link.html.twig' %}
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -1,11 +1,30 @@
|
|||||||
{#[Framadate][Pour diffusion aux sondés] Sondage: TESSSSSSSSSST#}
|
{#[Framadate][Pour diffusion aux sondés] Sondage: TESSSSSSSSSST#}
|
||||||
Ceci est le message qui doit être envoyé aux sondés.
|
{% extends 'email-base.html.twig' %}
|
||||||
Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.
|
{% block content %}
|
||||||
|
|
||||||
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
|
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.
|
||||||
|
<br>
|
||||||
|
Ce mail est le premier, comportant le message qui doit être envoyé aux sondés.<br>
|
||||||
|
|
||||||
Merci de votre confiance.
|
Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.<br>
|
||||||
Framadate
|
|
||||||
|
<br>
|
||||||
|
<fieldset>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<i>
|
||||||
|
|
||||||
|
{{ owner.pseudo }} ( {{ owner.email }} ) vient de créer un sondage intitulé : " <strong>{{ title }}
|
||||||
|
"</strong>.
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
Merci de bien vouloir participer au sondage à l'adresse suivante :<br>
|
||||||
|
|
||||||
|
</i>
|
||||||
|
{% include 'emails/partial/public_link.html.twig' %}
|
||||||
|
|
||||||
|
</blockquote>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
{#[Framadate][expiration] Sondage: TESSSSSSSSSST#}
|
{#[Framadate][expiration] Sondage: TESSSSSSSSSST#}
|
||||||
Ce sondage va bientôt expirer dans 1 jour, il ne sera plus possible d'y voter.
|
{% extends 'email-base.html.twig' %}
|
||||||
Dans 31 jours il sera supprimé. Vous pouvez exporter ses données àtotmoment en vous rendant à ce lien pour l'administrer.
|
{% block content %}
|
||||||
|
|
||||||
https://framadate.org/heh-le-test
|
|
||||||
|
|
||||||
Merci de votre confiance.
|
Ce sondage va bientôt expirer dans 1 jour, <br>
|
||||||
Framadate
|
<blockquote>
|
||||||
|
le {{ poll.expiracyDate | date('D Y-m-d') }}
|
||||||
|
</blockquote>
|
||||||
|
il ne sera plus possible d'y voter. <br>
|
||||||
|
Dans 31 jours il sera supprimé.<br>
|
||||||
|
Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer:
|
||||||
|
<br>
|
||||||
|
{% include 'emails/partial/admin_link.html.twig' %}
|
||||||
|
{% endblock %}
|
||||||
|
@ -1,4 +1,24 @@
|
|||||||
Merci de votre confiance.
|
<div class="footer-content" style="text-align:center; padding: 1em;">
|
||||||
<a href="{{ BASE_URL }}">
|
Framadate est un logiciel libre, tout le monde peut
|
||||||
Framadate
|
<a href="https://framateam.org/ux-framatrucs/channels/framadate">
|
||||||
|
l'améliorer.
|
||||||
</a>
|
</a>
|
||||||
|
<br>
|
||||||
|
Merci de votre confiance.
|
||||||
|
<br>
|
||||||
|
<a href="{{ BASE_URL }}">
|
||||||
|
Framadate {{ BASE_URL }}
|
||||||
|
</a>
|
||||||
|
<br>
|
||||||
|
<a href="https://framagit.org/framasoft/framadate/funky-framadate-front">
|
||||||
|
Sources du client Front end,
|
||||||
|
</a>
|
||||||
|
<a href="https://framagit.org/framasoft/framadate/framadate">
|
||||||
|
API back end.
|
||||||
|
</a>
|
||||||
|
<a href="https://framagit.org/framasoft/framadate/funky-framadate-front/-/wikis/home">
|
||||||
|
Documentation
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
{#[Framadate] Participation au sondage : TESSSSSSSSSST#}
|
{#[Framadate] Participation au sondage : TESSSSSSSSSST#}
|
||||||
Quelqu'un vient de modifier votre sondage accessible au lien suivant https://framadate.org/NGutN7jB9vtoGOEjCfUJWBwr/admin.
|
{% extends 'email-base.html.twig' %}
|
||||||
|
{% block content %}
|
||||||
|
<strong>
|
||||||
|
{{ poll.owner.pseudo }} ,
|
||||||
|
{{ poll.owner.email }} , </strong>
|
||||||
|
vient de modifier votre sondage accessible au lien suivant:
|
||||||
|
<br>
|
||||||
|
{% include 'emails/partial/admin_link.html.twig' %}
|
||||||
|
<br>
|
||||||
|
lien public:
|
||||||
|
<br>
|
||||||
|
{% include 'emails/partial/public_link.html.twig' %}
|
||||||
|
|
||||||
Merci de votre confiance.
|
{% endblock %}
|
||||||
Framadate
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
{#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#}
|
{#[Framadate][Réservé à l'auteur] Sondage: TESSSSSSSSSST#}
|
||||||
|
{% extends 'email-base.html.twig' %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
|
|
||||||
Voici la liste des {{ polls|length }} sondages
|
Voici la liste des {{ owner.polls|length }} sondages
|
||||||
<a href="{{ BASE_URL }}">
|
<a href="{{ BASE_URL }}">
|
||||||
Framadate
|
Framadate
|
||||||
</a>
|
</a>
|
||||||
@ -11,60 +14,13 @@
|
|||||||
Si vous n'avez pas demandé à recevoir cet email, veuillez en informer les administrateurs du site Framadate.
|
Si vous n'avez pas demandé à recevoir cet email, veuillez en informer les administrateurs du site Framadate.
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<ul>
|
<ul style="list-style-type: none">
|
||||||
{% for p in polls %}
|
{% for poll in owner.polls %}
|
||||||
<li>
|
<li class="poll-element" style="border: solid 1px #ccc; padding: 1em; margin-top: 1em;">
|
||||||
|
{% include 'emails/partial/poll.html.twig' %}
|
||||||
<strong>
|
|
||||||
{{ p.title }}
|
|
||||||
</strong>
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<div class="creation">
|
|
||||||
créé le {{ p.creationDate| date('Y m d ') }}
|
|
||||||
</div>
|
|
||||||
<div class="creation">
|
|
||||||
expirera le {{ p.expiracyDate| date('Y m d ') }}
|
|
||||||
</div>
|
|
||||||
<span class="votes-count">
|
|
||||||
{{ p.stacksOfVotes |length }} votes
|
|
||||||
</span>
|
|
||||||
<span class="votes-count">
|
|
||||||
{{ p.comments |length }} commentaires
|
|
||||||
</span>
|
|
||||||
{% if p.password |length %}
|
|
||||||
(accès avec mot de passe)
|
|
||||||
{% else %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<div class="public">
|
|
||||||
<span>
|
|
||||||
lien à donner aux votants:
|
|
||||||
</span>
|
|
||||||
{% if p.customUrl |length %}
|
|
||||||
<a href="{{ BASE_URL }}/poll/{{ p.customUrl }}">
|
|
||||||
{{ BASE_URL }}/poll/{{ p.customUrl }}
|
|
||||||
</a>
|
|
||||||
{% else %}
|
|
||||||
<a href="{{ BASE_URL }}/poll/{{ p.customUrl }}">
|
|
||||||
{{ BASE_URL }}/poll/{{ p.id }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="admin">
|
|
||||||
<span>
|
|
||||||
administration:
|
|
||||||
</span>
|
|
||||||
<a href="{{ BASE_URL }}/poll/{{ p.id }}/admin/{{ p.adminKey }}">{{ BASE_URL }}
|
|
||||||
/admin/{{ p.adminKey }}</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{% include 'emails/footer.html.twig' %}
|
|
||||||
|
{% endblock %}
|
||||||
|
2
templates/emails/partial/admin_link.html.twig
Normal file
2
templates/emails/partial/admin_link.html.twig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<a href="{{ BASE_URL }}/#/poll/{{ poll.id }}/admin/{{ poll.adminKey }}">{{ BASE_URL }}
|
||||||
|
/admin/{{ poll.adminKey }}</a>
|
39
templates/emails/partial/poll.html.twig
Normal file
39
templates/emails/partial/poll.html.twig
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<div class="poll">
|
||||||
|
<h1>
|
||||||
|
Sondage {{ poll.title }}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<div class="creation">
|
||||||
|
créé le {{ poll.creationDate| date('Y m d ') }}
|
||||||
|
</div>
|
||||||
|
<div class="creation">
|
||||||
|
expirera le {{ poll.expiracyDate| date('Y m d ') }}
|
||||||
|
</div>
|
||||||
|
<span class="votes-count">
|
||||||
|
{{ poll.stacksOfVotes |length }} votes
|
||||||
|
</span>
|
||||||
|
<span class="votes-count">
|
||||||
|
{{ poll.comments |length }} commentaires
|
||||||
|
</span>
|
||||||
|
{% if poll.password |length %}
|
||||||
|
(accès avec mot de passe)
|
||||||
|
{% else %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div class="public">
|
||||||
|
<span>
|
||||||
|
lien à donner aux votants:
|
||||||
|
</span>
|
||||||
|
{% include 'emails/partial/public_link.html.twig' %}
|
||||||
|
</div>
|
||||||
|
<div class="admin">
|
||||||
|
<span>
|
||||||
|
administration:
|
||||||
|
</span>
|
||||||
|
{% include 'emails/partial/admin_link.html.twig' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
11
templates/emails/partial/public_link.html.twig
Normal file
11
templates/emails/partial/public_link.html.twig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<span class="public-link">
|
||||||
|
{% if poll.customUrl |length %}
|
||||||
|
<a href="{{ BASE_URL }}/#/vote/poll/key/{{ poll.customUrl }}">
|
||||||
|
{{ BASE_URL }}/#/vote/poll/key/{{ poll.customUrl }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ BASE_URL }}/#/vote/poll/id/{{ poll.id }}">
|
||||||
|
{{ BASE_URL }}/#/vote/poll/id/{{ poll.id }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
13
templates/emails/vote-notification.html.twig
Normal file
13
templates/emails/vote-notification.html.twig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{#[Framadate] Notification d'un sondage : TESSSSSSSSSST#}
|
||||||
|
{% extends 'email-base.html.twig' %}
|
||||||
|
{% block content %}
|
||||||
|
<strong>
|
||||||
|
{{ owner.pseudo }}
|
||||||
|
</strong>
|
||||||
|
vient de voter au sondage.
|
||||||
|
<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 %}
|
Loading…
x
Reference in New Issue
Block a user