Commit 3fbc584b authored by Mat's avatar Mat

mail infolettre, améliore le tableau passé dans le template

parent 59bb00af
......@@ -60,7 +60,6 @@ class DefaultController extends MasterController
if ($form->isSubmitted() && $form->isValid())
{
$retour = $newsletter->sendLettreToGroup($lettre);
}
return $this->render('@Potage/Default/test.html.twig', array(
......
......@@ -19,10 +19,19 @@
<span>Potage</span>
</div>
<h1>Mon template twig</h1>
<h2>{{ subject }}</h2>
<h3>{{ to }}</h3>
{{ dump(body) }}
<h1>{{ subject }}</h1>
<h2>Période du {{ body.lettre.start|date('d-m-Y') }} au {{ body.lettre.end|date('d-m-Y') }}</h2>
<h3>Bonjour {{ to.fullName }},</h3>
<p>{{ body.groupe.nom }}<br>
{{ body.depot.localisation }}</p>
{% for i in body.lettre.sorted %}
{{ i }}
{% endfor %}
{{ dump() }}
</body>
</html>
\ No newline at end of file
......@@ -72,11 +72,16 @@ class Newsletter
$lettre->getOffre()->getId(),
$lettre->getOffre()->getSorted()
);
return array(
$infolettre = array(
'id' => $lettre->getId(),
'reference' => $lettre->getReference(),
'start' => $lettre->getStartedAt(),
'end' => $lettre->getEndedAt(),
'status' => $lettre->getStatus(),
'sorted' => $lettre->getSorted(),
);
return array(
'lettre' => $infolettre,
'groupe' => $groupe,
'depot' => $depot,
'infos' => $infos,
......@@ -112,9 +117,9 @@ class Newsletter
->setSubject($subject)
->setBody(
$twig->render('@Potage/Mail/bodyMail.html.twig', array(
'to' => $to,
'subject' => $subject,
'body' => $body,
'to' => $this->parseMail($to),
'subject' => $subject
)),
'text/html'
);
......@@ -158,7 +163,9 @@ class Newsletter
{
$to = array(
'fullName' => $utilisateurs[$i]['prenom'] .' '. $utilisateurs[$i]['nom'],
'email' => $utilisateurs[$i]['email']
'email' => $utilisateurs[$i]['email'],
'token' => $utilisateurs[$i]['id']
//encodePotageAccess($utilisateurs[$i]['id'], $lettre->getId())
);
$ret[$i] = array(
'to' => $this->parseMail($to),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment