Event when sending join notif

master
Daniel Berteaud 9 years ago
parent 29fe78db45
commit 95efab95a4
  1. 8
      templates/default/documentation.html.ep
  2. 7
      vroom.pl

@ -1229,6 +1229,14 @@ systemctl restart vroom.service</pre>
An API action was allowed An API action was allowed
</td> </td>
</tr> </tr>
<tr>
<td>
join_notification
</td>
<td>
An email notification was sent because someone joined a room
</td>
</tr>
</tbody> </tbody>
</table> </table>
</p> </p>

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

Loading…
Cancel
Save