test all emails

This commit is contained in:
Baptiste Lemoine 2020-04-12 18:04:10 +02:00
parent 7c9b97ac58
commit c133b1af99
6 changed files with 27 additions and 7 deletions

2
.env
View File

@ -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 ###

View File

@ -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(),

View File

@ -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, <br>
<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 %}

View File

@ -16,5 +16,9 @@
<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>

View File

@ -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:
<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' %}
{% endblock %}

View File

@ -4,7 +4,7 @@
<h2>
Voici la liste des {{ polls|length }} sondages
Voici la liste des {{ owner.polls|length }} sondages
<a href="{{ BASE_URL }}">
Framadate
</a>
@ -15,7 +15,7 @@
</div>
<hr>
<ul style="list-style-type: none">
{% for poll in polls %}
{% for poll in owner.polls %}
<li class="poll-element" style="border: solid 1px #ccc; padding: 1em; margin-top: 1em;">
{% include 'emails/partial/poll.html.twig' %}
</li>