mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
up mail templates
This commit is contained in:
parent
03cba297d5
commit
9a1b8c90a4
8
config/packages/dev/mailer.yaml
Normal file
8
config/packages/dev/mailer.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# config/packages/dev/mailer.yaml
|
||||||
|
framework:
|
||||||
|
mailer:
|
||||||
|
envelope:
|
||||||
|
sender: 'noreply@tktest.com'
|
||||||
|
recipients: ['tykayn@pm.me']
|
||||||
|
headers:
|
||||||
|
from: 'dev framadate funky <noreply@tktest.com>'
|
@ -9,7 +9,6 @@ use Swift_Mailer;
|
|||||||
use Swift_Message;
|
use Swift_Message;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
|
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sending emails controller
|
* sending emails controller
|
||||||
*
|
*
|
||||||
@ -83,7 +82,7 @@ class EmailsController extends AbstractController {
|
|||||||
$message = ( new Swift_Message( $config[ 'title' ] ) )
|
$message = ( new Swift_Message( $config[ 'title' ] ) )
|
||||||
->setContentType( "text/html" )
|
->setContentType( "text/html" )
|
||||||
->setCharset( 'UTF-8' )
|
->setCharset( 'UTF-8' )
|
||||||
->setFrom( [ 'ne-pas-repondre@framadate-api.cipherbliss.com' ] )
|
->setFrom( [ 'ne-pas-repondre@framadate-api.cipherbliss.com'] )
|
||||||
->setTo( [ $config[ 'owner' ]->getEmail() ] )
|
->setTo( [ $config[ 'owner' ]->getEmail() ] )
|
||||||
->setBody( $htmlbody, 'text/html' );
|
->setBody( $htmlbody, 'text/html' );
|
||||||
|
|
||||||
|
@ -405,16 +405,23 @@ class PollController extends EmailsController {
|
|||||||
$em = $this->getDoctrine()->getRepository( Owner::class );
|
$em = $this->getDoctrine()->getRepository( Owner::class );
|
||||||
$foundOwner = $em->findOneByEmail( $emailChoice );
|
$foundOwner = $em->findOneByEmail( $emailChoice );
|
||||||
if ( $foundOwner ) {
|
if ( $foundOwner ) {
|
||||||
$poll = $foundOwner->getPolls()[ 0 ];
|
|
||||||
$comment = $foundOwner->getComments()[ 0 ];
|
|
||||||
|
|
||||||
$sent = $this->sendOwnerPollsAction( $foundOwner );
|
$sent = $this->sendOwnerPollsAction( $foundOwner );
|
||||||
if ( $sent ) {
|
if ( $sent ) {
|
||||||
return $this->json( [ "message" => "test email sent to " . $foundOwner->getEmail() . "!" ], 200 );
|
$config = [
|
||||||
|
'owner' => $foundOwner,
|
||||||
|
'title' => $this->getParameter( 'WEBSITE_NAME' ) . ' | Mes sondages',
|
||||||
|
'email_template' => 'emails/owner-list.html.twig',
|
||||||
|
];
|
||||||
|
return $this->render( 'emails/owner-list.html.twig', $config );
|
||||||
|
// return $this->json( [ "message" => "test email sent to " . $foundOwner->getEmail() . "!" ], 200 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->json( [ "message" => "user with this email was not found" ], 400 );
|
|
||||||
|
// $this->sendMailWithVars( $config );
|
||||||
|
|
||||||
|
|
||||||
|
// return $this->json( [ "message" => "user with this email was not found" ], 400 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,12 +2,12 @@
|
|||||||
{% extends 'email-base.html.twig' %}
|
{% extends 'email-base.html.twig' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
<h1>✨ Création de votre sondage {{ title }} </h1>
|
||||||
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 <strong>{{ title }}</strong> vous recevez deux emails afin de ne pas transmettre par erreur aux sondés le lien d'administration de votre sondage.
|
||||||
<br>
|
<br>
|
||||||
Ce mail est le premier, comportant le message qui doit être envoyé aux sondés.<br>
|
Ce mail est le premier, comportant le message qui doit être envoyé aux sondés.<br>
|
||||||
|
|
||||||
Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.<br>
|
Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote. ✔️ <br>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<blockquote>
|
<blockquote>
|
||||||
<i>
|
<i>
|
||||||
|
|
||||||
{{ owner.pseudo }} ( {{ owner.email }} ) vient de créer un sondage intitulé : " <strong>{{ title }}
|
💡 {{ owner.pseudo }} ( {{ owner.email }} ) vient de créer un sondage intitulé : " <strong>{{ title }}
|
||||||
"</strong>.
|
"</strong>.
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
@ -3,13 +3,17 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
|
||||||
Ce sondage va bientôt expirer dans 1 jour, <br>
|
<h1> 🎌 Votre sondage {{ poll.title }} va bientôt expirer dans 1 jour,</h1>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
le {{ poll.expiracyDate | date('D Y-m-d') }}
|
le {{ poll.expiracyDate | date('D Y-m-d') }} :
|
||||||
</blockquote>
|
</blockquote>
|
||||||
il ne sera plus possible d'y voter. <br>
|
il ne sera plus possible d'y voter. <br>
|
||||||
Dans 31 jours il sera supprimé.<br>
|
Dans 31 jours il sera supprimé.<br>
|
||||||
Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer:
|
Vous pouvez exporter ses données à tout moment en vous rendant à ce lien pour l'administrer:
|
||||||
<br>
|
<br>
|
||||||
{% include 'emails/partial/admin_link.html.twig' %}
|
{% include 'emails/partial/admin_link.html.twig' %}
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
Plus de détails sur votre sondage :
|
||||||
|
{% include 'emails/partial/poll.html.twig' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
<a href="https://framagit.org/framasoft/framadate/funky-framadate-front">
|
<a href="https://framagit.org/framasoft/framadate/funky-framadate-front">
|
||||||
Sources du client Front end,
|
Sources du client Front end,
|
||||||
</a>
|
</a>
|
||||||
<a href="https://framagit.org/framasoft/framadate/framadate">
|
<a href="https://framagit.org/tykayn/date-poll-api">
|
||||||
API back end.
|
API back end.
|
||||||
</a>
|
</a>
|
||||||
<a href="https://framagit.org/framasoft/framadate/funky-framadate-front/-/wikis/home">
|
<a href="https://framagit.org/framasoft/framadate/funky-framadate-front/docs">
|
||||||
Documentation
|
Documentation
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
<a href="{{ BASE_URL }}/#/poll/{{ poll.id }}/admin/{{ poll.adminKey }}">{{ BASE_URL }}
|
<a href="{{ BASE_URL }}/#/poll/{{ poll.customUrl }}/admin/{{ poll.adminKey }}">{{ BASE_URL }}/#/poll/{{ poll.customUrl }}/admin/{{ poll.adminKey }}</a>
|
||||||
/admin/{{ poll.adminKey }}</a>
|
|
||||||
|
@ -2,11 +2,9 @@
|
|||||||
<h1>
|
<h1>
|
||||||
Sondage {{ poll.title }}
|
Sondage {{ poll.title }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<div class="creation">
|
<div class="creation">
|
||||||
créé le {{ poll.creationDate| date('Y m d ') }}
|
créé le {{ poll.createdAt| date('Y m d ') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="creation">
|
<div class="creation">
|
||||||
expirera le {{ poll.expiracyDate| date('Y m d ') }}
|
expirera le {{ poll.expiracyDate| date('Y m d ') }}
|
||||||
@ -18,22 +16,29 @@
|
|||||||
{{ poll.comments |length }} commentaires
|
{{ poll.comments |length }} commentaires
|
||||||
</span>
|
</span>
|
||||||
{% if poll.password |length %}
|
{% if poll.password |length %}
|
||||||
(accès avec mot de passe)
|
<div class="protected">
|
||||||
|
🔐 (accès avec mot de passe)
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% endif %}
|
||||||
|
{% if poll.isZeroKnowledge |length %}
|
||||||
|
<div class="protected-zero-knoledge">
|
||||||
|
🔐 Ce sondage bénéficie du chiffrement Zéro knowledge, nos administrateurs ne sont pas en mesure de connaître les informations du sondage.
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="public">
|
<div class="public">
|
||||||
<span>
|
<div>
|
||||||
lien à donner aux votants:
|
lien à donner aux votants:
|
||||||
</span>
|
</div>
|
||||||
{% include 'emails/partial/public_link.html.twig' %}
|
{% include 'emails/partial/public_link.html.twig' %}
|
||||||
</div>
|
</div>
|
||||||
<div class="admin">
|
<div class="admin">
|
||||||
<span>
|
<div>
|
||||||
administration:
|
administration:
|
||||||
</span>
|
</div>
|
||||||
{% include 'emails/partial/admin_link.html.twig' %}
|
{% include 'emails/partial/admin_link.html.twig' %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<span class="public-link">
|
<span class="public-link">
|
||||||
{% if poll.customUrl |length %}
|
{% if poll.customUrl |length %}
|
||||||
<a href="{{ BASE_URL }}/#/vote/poll/key/{{ poll.customUrl }}">
|
<a href="{{ BASE_URL }}/#/poll/{{ poll.customUrl }}/consultation">
|
||||||
{{ BASE_URL }}/#/vote/poll/key/{{ poll.customUrl }}
|
|
||||||
|
✉️ {{ BASE_URL }}/#/poll/{{ poll.customUrl }}/consultation
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ BASE_URL }}/#/vote/poll/id/{{ poll.id }}">
|
erreur, il manque la customUrl de ce sondage.
|
||||||
{{ BASE_URL }}/#/vote/poll/id/{{ poll.id }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user