Skip to content

Commit

Permalink
Adding message creator in the sent mail.
Browse files Browse the repository at this point in the history
  • Loading branch information
ngodfraind committed Feb 10, 2015
1 parent 0b30055 commit 4a887e1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions Manager/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ public function hasSubscribed(User $user, Forum $forum)
public function sendMessageNotification(Message $message, User $user)
{
$forum = $message->getSubject()->getCategory()->getForum();

$notifications = $this->notificationRepo->findBy(array('forum' => $forum));
$users = array();

Expand All @@ -283,7 +282,7 @@ public function sendMessageNotification(Message $message, User $user)

$title = $this->translator->trans(
'forum_new_message',
array('%forum%' => $forum->getResourceNode()->getName(), '%subject%' => $message->getSubject()->getTitle()),
array('%forum%' => $forum->getResourceNode()->getName(), '%subject%' => $message->getSubject()->getTitle(), '%author%' => $message->getCreator()->getUsername()),
'forum'
);

Expand All @@ -294,7 +293,6 @@ public function sendMessageNotification(Message $message, User $user)
$body = "<a href='{$url}'>{$title}</a><hr>{$message->getContent()}";

$this->mailManager->send($title, $body, $users);

}

/**
Expand Down
4 changes: 2 additions & 2 deletions Resources/translations/forum.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ forum_back_to_subjects: Back to subjects
forum_category_edit: 'Edit category'
forum_form_name: Name
forum_message_form_content: Content
forum_new_message: A new post was added to topic "%subject%" in forum "%forum%".
forum_new_message: A new post was added to topic "%subject%" in forum "%forum% by %author%".
forum_new_subject: A new topic was initiated in forum "%forum%".
forum_options_form_messages: Posts per page
forum_options_form_subjects: Topics per page
Expand Down Expand Up @@ -48,4 +48,4 @@ no: No
notifications_explanation: Global notifications will send a mail to each user who are granted this forum access each time a new message is created.
activate_global_notifications: Activate global notifications
disable_global_notifications: Disable global notifications
responses: Replies
responses: Replies
4 changes: 2 additions & 2 deletions Resources/translations/forum.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ forum_back_to_subjects: Volver a las temas
forum_category_edit: 'Editar una categoría'
forum_form_name: Nombre
forum_message_form_content: Cotenido
forum_new_message: 'Un nuevo mensaje fue agregada en tema "%subject%", en el foro "%forum%".'
forum_new_message: 'Un nuevo mensaje fue agregada en tema "%subject%", en el foro "%forum% por %author%".'
forum_options_form_messages: 'Mensajes por página'
forum_options_form_subjects: 'Temas por página'
forum_settings: 'Configuración del foro'
Expand Down Expand Up @@ -47,4 +47,4 @@ no: no
notifications_explanation: Cuando se agrega un mensaje, la activación de las notificaciones globales conlleva el envío de un mail a los usuarios que tienen acceso al foro.
activate_global_notifications: Activar las notificaciones globales
disable_global_notifications: Anular las notificaciones globales
responses: Respuestas
responses: Respuestas
4 changes: 2 additions & 2 deletions Resources/translations/forum.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ forum_form_name: Nom
forum_options_form_subjects: Sujets par page
forum_options_form_messages: Messages par page
forum_subject_title_form_title: Titre
forum_new_message: Un nouveau message a été ajouté dans le sujet "%subject%" du forum "%forum%".
forum_new_message: Un nouveau message a été ajouté dans le sujet "%subject%" du forum "%forum% par %author%".
forum_new_subject: Un nouveau sujet a été ajouté dans le forum "%forum%".
last_message: Dernier message
messages: Messages
Expand Down Expand Up @@ -48,4 +48,4 @@ no: Non
notifications_explanation: L'activation des notifications globales entraîne l'envoi d'un mail aux utilisateurs ayant accès au forum lors de l'ajout d'un message.
activate_global_notifications: Activer les notifications globales
disable_global_notifications: Annuler les notifications globales
responses: Réponses
responses: Réponses

0 comments on commit 4a887e1

Please sign in to comment.