diff --git a/src/Intracto/SecretSantaBundle/Controller/EntryController.php b/src/Intracto/SecretSantaBundle/Controller/EntryController.php index cd217075..16e6b930 100644 --- a/src/Intracto/SecretSantaBundle/Controller/EntryController.php +++ b/src/Intracto/SecretSantaBundle/Controller/EntryController.php @@ -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])); + } } diff --git a/src/Intracto/SecretSantaBundle/Mailer/MailerService.php b/src/Intracto/SecretSantaBundle/Mailer/MailerService.php index f5225dd1..9b513aef 100644 --- a/src/Intracto/SecretSantaBundle/Mailer/MailerService.php +++ b/src/Intracto/SecretSantaBundle/Mailer/MailerService.php @@ -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' + ) + ); + } } \ No newline at end of file diff --git a/src/Intracto/SecretSantaBundle/Resources/translations/messages.en.yml b/src/Intracto/SecretSantaBundle/Resources/translations/messages.en.yml index 71a2a976..bef61d77 100644 --- a/src/Intracto/SecretSantaBundle/Resources/translations/messages.en.yml +++ b/src/Intracto/SecretSantaBundle/Resources/translations/messages.en.yml @@ -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 @@ -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%,
+
+ 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. + 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,

You have requested us to resend your activation mail with the event manage link(s)
' subject: 'Resend activation mail' @@ -369,6 +386,7 @@ flashes: resent: Resent!
The e-mail to %email% has been resent.
entry: wishlist_updated:

Wishlist updated

We've sent out our gnomes to notify your Secret Santa about your wishes! + poke_buddy:

Poked

We've sent out our gnomes to ask your Secret Santa to add items to the wishlist! edit_email:

Not saved

There is an error in the email address. saved_email:

Saved

The new email address was saved. We also resent the e-mail. analytics: diff --git a/src/Intracto/SecretSantaBundle/Resources/translations/messages.es.yml b/src/Intracto/SecretSantaBundle/Resources/translations/messages.es.yml index dfd8b979..42e60084 100644 --- a/src/Intracto/SecretSantaBundle/Resources/translations/messages.es.yml +++ b/src/Intracto/SecretSantaBundle/Resources/translations/messages.es.yml @@ -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á vacía. static: report: max_results: Resultados máx. @@ -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ñadir más personas + do: Añ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 @@ -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á esperando tu lista de deseos + message: + html: > + Estimado %name%,
+
+ Tu amigote Secret Santa está esperando tu lista de deseos.
+
+ Haz clic en el siguiente enlace para añadir cosas a tu lista de deseos. + txt: > + Estimado %name%, + + Tu amigote Secret Santa está esperando tu lista de deseos. + + Haz clic en el siguiente enlace para añadir cosas a tu lista de deseos. flashes: manage: email_validated: > @@ -239,6 +256,7 @@ flashes: resent: ¡Reenviado!
El correo electrónico %email% ha sido reenviado.
entry: wishlist_updated:

Lista de deseos actualizada

¡Hemos enviado a nuestros gnomos para que notifiquen a tu Secret Santa tus deseos! + poke_buddy:

Empujado

Nuestros gnomos están de camino para avisar tu amigote Secret Santa que su lista de deseos está vacía. edit_email:

No guardado

Hay un error en la dirección de correo electrónico. saved_email:

Guardado

Se guardó la nueva dirección de correo electrónico. También reenviamos el correo electrónico. analytics: diff --git a/src/Intracto/SecretSantaBundle/Resources/translations/messages.fr.yml b/src/Intracto/SecretSantaBundle/Resources/translations/messages.fr.yml index 1eefec94..1fab4dc8 100644 --- a/src/Intracto/SecretSantaBundle/Resources/translations/messages.fr.yml +++ b/src/Intracto/SecretSantaBundle/Resources/translations/messages.fr.yml @@ -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 @@ -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 @@ -311,6 +313,21 @@ emails: Vous avez demandé à connaître toutes les attributions de votre liste. Sachez que chaque membre en sera informé 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%,
+
+ 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. + 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: > @@ -327,5 +344,6 @@ flashes: resent: Renvoyé !
L'e-mail à %email% a bien été renvoyé.
entry: wishlist_updated:

Liste de souhaits mise à jour

Nous avons envoyé nos gnomes afin qu'ils avertissent votre Père-Noël secret de vos souhaits ! + poke_buddy:

Stimulé

Nos gnomes sont en route pour avertir votre copain Secret Santa que leur liste de souhaits est vide. edit_email:

Non enregistrée

Il y a une erreur dans l'adresse e-mail. saved_email:

Enregistrée

La nouvelle adresse e-mail a été enregistrée. Nous avons également renvoyé l'e-mail. diff --git a/src/Intracto/SecretSantaBundle/Resources/translations/messages.nl.yml b/src/Intracto/SecretSantaBundle/Resources/translations/messages.nl.yml index f2f4d3ad..a3175ceb 100644 --- a/src/Intracto/SecretSantaBundle/Resources/translations/messages.nl.yml +++ b/src/Intracto/SecretSantaBundle/Resources/translations/messages.nl.yml @@ -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 @@ -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%,
+
+ Jouw Secret Santa maatje wacht op jouw wenslijst.
+
+ 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,

U heeft ons gevraagd om de activatie mail met de link(s) naar de beheerpagina opnieuw te verzenden
' subject: 'Activatie mail opnieuw verzenden' @@ -345,11 +362,12 @@ flashes: not_deleted:

Niet verwijderd

De bevestiging verliep foutief. expose: not_exposed:

Mailinglijst niet gestuurd

De bevestiging verliep foutief. - exposed:

Mailinglijst gestuurd

All gebruikers worden op de hoogte gebracht wanneer zij hun wenslijst bekijken. + exposed:

Mailinglijst gestuurd

Alle gebruikers worden op de hoogte gebracht wanneer zij hun wenslijst bekijken. resend: resent: Opnieuw verstuurd!
De e-mail aan %email% werd opnieuw verstuurd.
entry: wishlist_updated:

Verlanglijst geüpdatet

We hebben onze kaboutertjes op pad gestuurd om jouw Secret Santa te vertellen op welke cadeau's je vurig hoopt! + poke_buddy:

Gepord

Onze kabourtjes zijn onderweg naar jouw Secret Santa om te vragen naar interessante spulletjes voor op hun verlanglijstje. edit_email:

Niet bewaard

Er is wat fout met het e-mailadres. saved_email:

Bewaard

Het nieuwe e-mailadres werd bewaard. We hebben ook de e-mail opnieuw verstuurd. forgot_manage_link: diff --git a/src/Intracto/SecretSantaBundle/Resources/views/Emails/pokebuddy.html.twig b/src/Intracto/SecretSantaBundle/Resources/views/Emails/pokebuddy.html.twig new file mode 100644 index 00000000..0679d2be --- /dev/null +++ b/src/Intracto/SecretSantaBundle/Resources/views/Emails/pokebuddy.html.twig @@ -0,0 +1,66 @@ +{% extends "IntractoSecretSantaBundle:Emails:basemail.html.twig" %} +{% block main %} + + + + + + + + + +
+ + +

{{ "emails.poke_buddy.message.html"|trans({"%name%": entry.name })|raw }}

+
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + {{ "btn.update_wishlist"|trans }} + +
+ +
+ +
+
+ +
+
+{% endblock %} \ No newline at end of file diff --git a/src/Intracto/SecretSantaBundle/Resources/views/Emails/pokebuddy.txt.twig b/src/Intracto/SecretSantaBundle/Resources/views/Emails/pokebuddy.txt.twig new file mode 100644 index 00000000..ede02bbf --- /dev/null +++ b/src/Intracto/SecretSantaBundle/Resources/views/Emails/pokebuddy.txt.twig @@ -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 \ No newline at end of file diff --git a/src/Intracto/SecretSantaBundle/Resources/views/Entry/index.html.twig b/src/Intracto/SecretSantaBundle/Resources/views/Entry/index.html.twig index 4038d5f2..7eaf0bc8 100644 --- a/src/Intracto/SecretSantaBundle/Resources/views/Entry/index.html.twig +++ b/src/Intracto/SecretSantaBundle/Resources/views/Entry/index.html.twig @@ -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}) }}. {{ 'poke.poke'|trans }} {{ 'poke.poke_sentence'|trans|raw }} {% endif %} {% else %}