Skip to content

Commit

Permalink
Merge pull request #95 from NielsRoels/pokeBuddy
Browse files Browse the repository at this point in the history
Poke buddy
  • Loading branch information
tvlooy committed Apr 7, 2016
2 parents b4d6ca1 + 89eadbb commit dc8f041
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 11 deletions.
20 changes: 20 additions & 0 deletions src/Intracto/SecretSantaBundle/Controller/EntryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,24 @@ public function dumpEntriesAction()

return ['entries' => $this->entryRepository->findAfter($startCrawling)];
}

/**
* @Route("/poke/{url}/{entryId}", name="poke_buddy")
* @Template()
*/
public function pokeBuddyAction($url, $entryId)
{
$entry = $this->entryRepository->find($entryId);

$entryService = $this->get('intracto_secret_santa.mail');
$entryService->sendPokeMailToBuddy($entry);

$translator = $this->get('translator');
$this->get('session')->getFlashBag()->add(
'success',
$translator->trans('flashes.entry.poke_buddy')
);

return $this->redirect($this->generateUrl('entry_view', ['url' => $url]));
}
}
31 changes: 31 additions & 0 deletions src/Intracto/SecretSantaBundle/Mailer/MailerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,35 @@ public function sendForgotManageLinkMail($email)

return true;
}

/**
* @param Entry $entry
*/
public function sendPokeMailToBuddy(Entry $entry)
{
$this->translator->setLocale($entry->getPool()->getLocale());
$this->mailer->send(\Swift_Message::newInstance()
->setSubject($this->translator->trans('emails.poke_buddy.subject'))
->setFrom($this->adminEmail, $this->translator->trans('emails.sender'))
->setTo($entry->getEmail(), $entry->getName())
->setBody(
$this->templating->render(
'IntractoSecretSantaBundle:Emails:pokebuddy.html.twig',
[
'entry' => $entry,
]
),
'text/html'
)
->addPart(
$this->templating->render(
'IntractoSecretSantaBundle:Emails:pokebuddy.txt.twig',
[
'entry' => $entry,
]
),
'text/plain'
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ entry:
title: Your wishlist
description: To help your Secret Santa, you can leave a wishlist here. Our gnomes will take care of communicating this to your Secret Santa. You can re-order the list by dragging the items in place.
wishlist_empty: Your wishlist is empty. Add something!

poke:
poke: Poke
poke_sentence: your buddy to let him/her know their wishlist is empty.
static:
privacy_policy:
title: Privacy Policy
Expand Down Expand Up @@ -350,6 +352,21 @@ emails:
You have requested all matches in your mailing list. Please be aware that all the members will be able to see this on their wishlist page.
Following is an overview of which members are supposed to get gifts for which users.
poke_buddy:
subject: Your buddy is waiting for your wishlist
message:
html: >
Dear %name%, <br/>
<br/>
Your Secret Santa buddy is waiting for you to add some items to your wishlist.<br/>
<br/>
Click the link below and add some stuff to your wishlist you'd like.
txt: >
Dear %name%,
Your Secret Santa buddy is waiting for you to add some items to your wishlist.
Click the link below and add some stuff to your wishlist you'd like.
forgot_link:
text: 'Hi there, <br /><br />You have requested us to resend your activation mail with the event manage link(s)<br />'
subject: 'Resend activation mail'
Expand All @@ -369,6 +386,7 @@ flashes:
resent: <strong>Resent!</strong><br/>The e-mail to %email% has been resent.<br/>
entry:
wishlist_updated: <h4>Wishlist updated</h4>We've sent out our gnomes to notify your Secret Santa about your wishes!
poke_buddy: <h4>Poked</h4> We've sent out our gnomes to ask your Secret Santa to add items to the wishlist!
edit_email: <h4>Not saved</h4> There is an error in the email address.
saved_email: <h4>Saved</h4> The new email address was saved. We also resent the e-mail.
analytics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ entry:
title: Tu lista de deseos
description: Para ayudar a tu Secret Santa, puedes dejar una lista de deseos aquí. Nuestros gnomos se encargarán de comunicársela a tu Secret Santa. Puedes reordenar la lista moviendo los elementos hacia el lugar adecuado.
wishlist_empty: Tu lista de deseos está vacía. ¡Añade algo!

poke:
poke: Empuja
poke_sentence: tu amigote para avisarla que su lista de deseos est&aacute; vac&iacute;a.
static:
report:
max_results: Resultados máx.
Expand All @@ -146,8 +148,8 @@ btn:
add_person: Añadir persona
remove_person: Quitar esta persona
import_persons:
open: Añadir más personas
do: Añadir a tu fiesta
open: A&ntilde;adir m&aacute;s personas
do: A&ntilde;adir a tu fiesta
create_event: ¡Crear tu evento!
create_new_list: ¡Crear una nueva lista Secret Santa!
delete_list: Borrar mi lista Secret Santa
Expand Down Expand Up @@ -223,6 +225,21 @@ emails:
Has solicitado todas las atribuciones en tu lista de deseos. Por favor, ten en cuenta que todos los miembros podrán ver eso en su página de la lista de deseos.
A continuación un resumen de qué miembros se supone que van a recibir regalos y de parte de qué usuarios.
poke_buddy:
subject: Tu amigote est&aacute; esperando tu lista de deseos
message:
html: >
Estimado %name%, <br/>
<br/>
Tu amigote Secret Santa est&aacute; esperando tu lista de deseos.<br/>
<br/>
Haz clic en el siguiente enlace para a&ntilde;adir cosas a tu lista de deseos.
txt: >
Estimado %name%,
Tu amigote Secret Santa est&aacute; esperando tu lista de deseos.
Haz clic en el siguiente enlace para a&ntilde;adir cosas a tu lista de deseos.
flashes:
manage:
email_validated: >
Expand All @@ -239,6 +256,7 @@ flashes:
resent: <strong>¡Reenviado!</strong><br/>El correo electrónico %email% ha sido reenviado.<br/>
entry:
wishlist_updated: <h4>Lista de deseos actualizada</h4>¡Hemos enviado a nuestros gnomos para que notifiquen a tu Secret Santa tus deseos!
poke_buddy: <h4>Empujado</h4> Nuestros gnomos est&aacute;n de camino para avisar tu amigote Secret Santa que su lista de deseos est&aacute; vac&iacute;a.
edit_email: <h4>No guardado</h4> Hay un error en la dirección de correo electrónico.
saved_email: <h4>Guardado</h4> Se guardó la nueva dirección de correo electrónico. También reenviamos el correo electrónico.
analytics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ entry:
title: Votre liste de souhaits
description: Afin d'aider votre Père-Noël Secret, vous pouvez laisser une liste de souhaits ici. Nos gnomes prendront soin de la communiquer à votre Père-Noël Secret. Vous pouvez réorganiser la liste en faisant glisser les éléments.
wishlist_empty: Votre liste de souhaits est vide. Ajoutez quelque chose !

poke:
poke: Stimule
poke_sentence: votre copain Secret Santa de remplir leur liste de souhaits.
static:
privacy_policy:
title: Protection vie privée
Expand Down Expand Up @@ -218,7 +220,7 @@ static:

label:
name: Nom
host: l'administrateur
host: L'administrateur
participants: Participants
email: E-mail
date_party: Date de votre Secret Santa party
Expand Down Expand Up @@ -311,6 +313,21 @@ emails:
Vous avez demand&eacute; à conna&icirc;tre toutes les attributions de votre liste. Sachez que chaque membre en sera inform&eacute; sur sa liste de souhaits.
Ci-dessous, la liste des membres et leurs copains cadeaux.
poke_buddy:
subject: Votre copain est en attente de votre liste de souhaits
message:
html: >
Cher(e) %name%, <br/>
<br/>
Votre copain Secret Santa est en attente de votre liste de souhaits.<br/>
<br/>
Cliquez sur le boutton ci-dessous afin d'ajouter des choses a votre liste de souhaits.
txt: >
Cher(e) %name%,
Votre copain Secret Santa est en attente de votre liste de souhaits.
Cliquez sur le boutton ci-dessous afin d'ajouter des choses a votre liste de souhaits.
flashes:
manage:
email_validated: >
Expand All @@ -327,5 +344,6 @@ flashes:
resent: <strong>Renvoyé !</strong><br/>L'e-mail à %email% a bien été renvoyé.<br/>
entry:
wishlist_updated: <h4>Liste de souhaits mise à jour</h4>Nous avons envoyé nos gnomes afin qu'ils avertissent votre Père-Noël secret de vos souhaits !
poke_buddy: <h4>Stimulé</h4> Nos gnomes sont en route pour avertir votre copain Secret Santa que leur liste de souhaits est vide.
edit_email: <h4>Non enregistrée</h4> Il y a une erreur dans l'adresse e-mail.
saved_email: <h4>Enregistrée</h4> La nouvelle adresse e-mail a été enregistrée. Nous avons également renvoyé l'e-mail.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ entry:
title: Jouw verlanglijstje
description: Om je Secret Santa een handje te helpen, kan je jouw verlanglijst hier opstellen. Onze kaboutertjes zullen je zware lijst tot bij hem of haar brengen. Je kan de lijst opnieuw sorteren door items te verslepen.
wishlist_empty: Je verlanglijst is leeg. Voeg iets toe!

poke:
poke: Por
poke_sentence: jouw Secret Santa maatje om hem of haar te laten weten dat je wacht op een verlanglijstje.
static:
privacy_policy:
title: Privacybeleid
Expand Down Expand Up @@ -331,6 +333,21 @@ emails:
Je hebt een overzicht van alle koppelingen in je mailinglijst aangevraagd. Let op: Alle leden kunnen dit zien op hun wenslijst pagina.
Hier volgt het overzicht van welke leden een cadeau zouden moeten voorzien voor welke leden.
poke_buddy:
subject: Je maatje wacht op jouw verlanglijstje
message:
html: >
Beste %name%, <br/>
<br/>
Jouw Secret Santa maatje wacht op jouw wenslijst. <br/>
<br/>
Klik op de onderstaande link en voeg dingen toe aan jouw wenslijst.
txt: >
Beste %name%,
Jouw Secret Santa maatje wacht op jouw wenslijst.
Klik op de onderstaande link en voeg dingen toe aan jouw wenslijst.
forgot_link:
text: 'Hallo, <br /><br />U heeft ons gevraagd om de activatie mail met de link(s) naar de beheerpagina opnieuw te verzenden<br />'
subject: 'Activatie mail opnieuw verzenden'
Expand All @@ -345,11 +362,12 @@ flashes:
not_deleted: <h4>Niet verwijderd</h4> De bevestiging verliep foutief.
expose:
not_exposed: <h4>Mailinglijst niet gestuurd</h4> De bevestiging verliep foutief.
exposed: <h4>Mailinglijst gestuurd</h4> All gebruikers worden op de hoogte gebracht wanneer zij hun wenslijst bekijken.
exposed: <h4>Mailinglijst gestuurd</h4> Alle gebruikers worden op de hoogte gebracht wanneer zij hun wenslijst bekijken.
resend:
resent: <strong>Opnieuw verstuurd!</strong><br/>De e-mail aan %email% werd opnieuw verstuurd.<br/>
entry:
wishlist_updated: <h4>Verlanglijst geüpdatet</h4>We hebben onze kaboutertjes op pad gestuurd om jouw Secret Santa te vertellen op welke cadeau's je vurig hoopt!
poke_buddy: <h4>Gepord</h4> Onze kabourtjes zijn onderweg naar jouw Secret Santa om te vragen naar interessante spulletjes voor op hun verlanglijstje.
edit_email: <h4>Niet bewaard</h4> Er is wat fout met het e-mailadres.
saved_email: <h4>Bewaard</h4> Het nieuwe e-mailadres werd bewaard. We hebben ook de e-mail opnieuw verstuurd.
forgot_manage_link:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% extends "IntractoSecretSantaBundle:Emails:basemail.html.twig" %}
{% block main %}
<table width="640" border="0" cellpadding="0" cellspacing="0" align="center" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color:#333333; line-height: 25px;">
<tr>
<td width="37" align="left">
<img src="http://www.eproof.be/assets/intracto/secret-santa/x.gif" width="37" style="display:block;" border="0" />
</td>
<td width="566">
<p>{{ "emails.poke_buddy.message.html"|trans({"%name%": entry.name })|raw }}</p>
</td>
<td width="37" align="right">
<img src="http://www.eproof.be/assets/intracto/secret-santa/x.gif" width="37" style="display:block;" border="0" />
</td>
</tr>
<tr>
<td width="640" colspan="3">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="52" height="45" valign="top">
<img src="http://www.eproof.be/assets/intracto/secret-santa/left-btn.jpg" width="52" height="45" style="display:block;" border="0" />
</td>
<td height="45" valign="top">
<table border="0" cellpadding="0" cellspacing="0" height="45">
<tr>
<td height="1" style="line-height: 1px;background-color: #ffffff" valign="top">
<img src="http://www.eproof.be/assets/intracto/secret-santa/x.gif" height="1" style="display:block;" border="0" />
</td>
</tr>
<tr>
<td height="1" style="line-height: 1px;background-color: #a9181b" valign="top">
<img src="http://www.eproof.be/assets/intracto/secret-santa/x.gif" height="1" style="display:block;" border="0" />
</td>
</tr>
<tr>
<td height="1" style="line-height: 1px;background-color: #ea1e35" valign="top">
<img src="http://www.eproof.be/assets/intracto/secret-santa/x.gif" height="1" style="display:block;" border="0" />
</td>
</tr>
<tr>
<td height="40" valign="middle" style="background-color:#bd1019;">
<a href="{{ url("entry_view", { "url": entry.url, "_locale": entry.pool.locale }) }}" target="_blank" style="font-family: Arial, Helvetica, sans-serif;background-color:#bd1019;font-size:18px;color:#ffffff;text-decoration: none;display:block;line-height: 40px;height: 40px">
{{ "btn.update_wishlist"|trans }}
</a>
</td>
</tr>
<tr>
<td height="1" style="line-height: 1px;background-color: #d31927" valign="top">
<img src="http://www.eproof.be/assets/intracto/secret-santa/x.gif" height="1" style="display:block;" border="0" />
</td>
</tr>
<tr>
<td height="1" style="line-height: 1px;background-color: #a91721" valign="top">
<img src="http://www.eproof.be/assets/intracto/secret-santa/x.gif" height="1" style="display:block;" border="0" />
</td>
</tr>
</table>
</td>
<td width="59" height="45" valign="top">
<img src="http://www.eproof.be/assets/intracto/secret-santa/right-btn.jpg" width="59" height="45" style="display:block;" border="0" />
</td>
</tr>
</table>
</td>
</tr>
</table>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ "emails.poke_buddy.message.txt"|trans({"%name%": entry.name})|raw }}

{{ "btn.update_wishlist"|trans }}:
{{ url("entry_view", { "url": entry.url, "_locale": entry.pool.locale }) }}

{{ "emails.base.created_by"|trans }} http://www.intracto.com
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{% if(secret_santa.getwishlist) %}
{{ secret_santa.getwishlist|linkify|raw }}
{% else %}
{{ 'entry.wishlist_not_provided'|trans({'%name%': entry.entry.name}) }}.
{{ 'entry.wishlist_not_provided'|trans({'%name%': entry.entry.name}) }}. <a href="{{ path('poke_buddy', { 'url': entry.url, 'entryId': entry.entry.id }) }}">{{ 'poke.poke'|trans }}</a> {{ 'poke.poke_sentence'|trans|raw }}
{% endif %}
{% else %}
<ul class="wishlist">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
<div class="clearfix"></div>
<div style="display: block; overflow: auto; margin-bottom: 10px">
<button style="float: right;" type="button" class="btn btn-mini btn-success add-new-entry">
<i class="fa fa-plus-circle fa-inverse"></i> {{ 'btn.add_person'|trans }}
<i class="fa fa-plus-circle fa-inverse"></i> {{ 'btn.add_person'|trans|raw }}
</button>
</div>
<div style="display: block; overflow: auto">
<button style="float: right" type="button" class="btn btn-mini btn-success add-import-entry">
<i class="fa fa-plus-circle fa-inverse"></i> {{ 'btn.import_persons.open'|trans }}
<i class="fa fa-plus-circle fa-inverse"></i> {{ 'btn.import_persons.open'|trans|raw }}
</button>
</div>
<table class="entries table table-striped mysanta">
Expand Down

0 comments on commit dc8f041

Please sign in to comment.