Fix email notification when someone join a room

master
Daniel Berteaud 10 years ago
parent e94b6cd955
commit 22e8dc1ef5
  1. 5
      vroom.pl

@ -1634,10 +1634,11 @@ any '/api' => sub {
# Notify the backend when we join a room # Notify the backend when we join a room
elsif ($req->{action} eq 'join'){ elsif ($req->{action} eq 'join'){
my $name = $req->{param}->{name} || ''; 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 # Send notifications
my $recipients = $self->get_notification($room); my $recipients = $self->get_notification($room->{name});
foreach my $rcpt (keys %{$recipients}){ foreach my $rcpt (keys %{$recipients}){
$self->app->log->debug('Sending an email to ' . $recipients->{$rcpt}->{email});
my $sent = $self->mail( my $sent = $self->mail(
to => $recipients->{$rcpt}->{email}, to => $recipients->{$rcpt}->{email},
subject => $subj, subject => $subj,

Loading…
Cancel
Save