From 22e8dc1ef5dac210209e0bbb5c980edce2208844 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 22 Jan 2015 22:26:06 +0100 Subject: [PATCH] Fix email notification when someone join a room --- vroom.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vroom.pl b/vroom.pl index 2bf71b4..9285144 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1634,10 +1634,11 @@ any '/api' => sub { # Notify the backend when we join a room elsif ($req->{action} eq 'join'){ my $name = $req->{param}->{name} || ''; - my $subj = sprintf($self->l('s_JOINED_ROOM_s'), ($name eq '') ? $self->l('SOMEONE') : $name, $room); + my $subj = sprintf($self->l('s_JOINED_ROOM_s'), ($name eq '') ? $self->l('SOMEONE') : $name, $room->{name}); # Send notifications - my $recipients = $self->get_notification($room); + my $recipients = $self->get_notification($room->{name}); foreach my $rcpt (keys %{$recipients}){ + $self->app->log->debug('Sending an email to ' . $recipients->{$rcpt}->{email}); my $sent = $self->mail( to => $recipients->{$rcpt}->{email}, subject => $subj,