Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mathieu
potage
Commits
3fbc584b
Commit
3fbc584b
authored
Aug 28, 2018
by
Mat
Browse files
mail infolettre, améliore le tableau passé dans le template
parent
59bb00af
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/PotageBundle/Controller/DefaultController.php
View file @
3fbc584b
...
...
@@ -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
(
...
...
src/PotageBundle/Resources/views/Mail/bodyMail.html.twig
View file @
3fbc584b
...
...
@@ -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
src/PotageBundle/Services/Newsletter.php
View file @
3fbc584b
...
...
@@ -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
),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment