From 95efab95a47c504b78459738a2c2d8ecefad62e2 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 26 Jul 2015 21:38:42 +0200 Subject: [PATCH] Event when sending join notif --- templates/default/documentation.html.ep | 8 ++++++++ vroom.pl | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/templates/default/documentation.html.ep b/templates/default/documentation.html.ep index 05e7963..c6ada2b 100644 --- a/templates/default/documentation.html.ep +++ b/templates/default/documentation.html.ep @@ -1229,6 +1229,14 @@ systemctl restart vroom.service An API action was allowed + + + join_notification + + + An email notification was sent because someone joined a room + +

diff --git a/vroom.pl b/vroom.pl index 9d9f1e9..9ffc573 100755 --- a/vroom.pl +++ b/vroom.pl @@ -2068,8 +2068,11 @@ any '/api' => sub { # Send notifications my $recipients = $self->get_email_notifications($room->{name}); foreach my $rcpt (keys %{$recipients}){ - # TODO: log an event - $self->app->log->debug('Sending an email to ' . $recipients->{$rcpt}->{email}); + $self->log_event( + event => 'join_notification', + msg => 'Sending an email to ' . $recipients->{$rcpt}->{email} . + ' to inform that someone joined room ' . $room->{name} + ); my $sent = $self->mail( to => $recipients->{$rcpt}->{email}, subject => $subj,