From eaf20b6a1300513704d592e570948033e83f2ca5 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 13 May 2014 17:52:03 +0200 Subject: [PATCH] Send join password in email invitations Fix #26 --- lib/Vroom/I18N/en.pm | 1 + lib/Vroom/I18N/fr.pm | 1 + public/vroom.pl | 6 ++++-- templates/default/invite.email_html.ep | 5 +++++ templates/default/invite.email_text.ep | 4 ++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm index eab972b..5d45f87 100644 --- a/lib/Vroom/I18N/en.pm +++ b/lib/Vroom/I18N/en.pm @@ -18,6 +18,7 @@ our %Lexicon = ( "A_WEBCAM" => "A webcam", "A_MIC" => "A microphone", "WHEN_YOU_ARE_READY" => "When you are ready, go to this address to join the conference", + "YOU_WILL_NEED_THIS_PASSWORD" => "The following password is needed to join the room", "HAVE_A_NICE_MEETING" => "Have a nice meeting :-)", "EMAIL_SIGN" => "VROOM! And video conferencing becomes free, simple and safe", "FEEDBACK" => "Feedback", diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm index b29df40..7a1f9ef 100644 --- a/lib/Vroom/I18N/fr.pm +++ b/lib/Vroom/I18N/fr.pm @@ -20,6 +20,7 @@ our %Lexicon = ( "A_WEBCAM" => "Une webcam", "A_MIC" => "Un micro", "WHEN_YOU_ARE_READY" => "Quand vous êtes prêt, rendez-vous sur cette adresse pour joindre la conférence", + "YOU_WILL_NEED_THIS_PASSWORD" => "Le mot de passe suivant est nécessaire pour rejoindre le salon", "HAVE_A_NICE_MEETING" => "Bonne réunion :-)", "EMAIL_SIGN" => "VROOM! Et la visio conférence devient libre, simple et sûr", "FEEDBACK" => "Retour d'expérience", diff --git a/public/vroom.pl b/public/vroom.pl index 330cd58..3cb32d6 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -437,12 +437,13 @@ post '/action' => sub { ); } $self->stash(room => $room); + my $data = $self->get_room($room); return $self->render( json => { msg => sprintf ($self->l("ERROR_ROOM_s_DOESNT_EXIST"), $room) }, status => '500' - ) unless ($self->get_room($room)); + ) unless ($data); if ($action eq 'invite'){ my $rcpt = $self->param('recipient'); @@ -453,7 +454,8 @@ post '/action' => sub { ], data => [ template => 'invite', - room => $room + room => $room, + joinPassword => $data->{join_password} ], ) || return $self->render( diff --git a/templates/default/invite.email_html.ep b/templates/default/invite.email_html.ep index f140d8f..f08087e 100644 --- a/templates/default/invite.email_html.ep +++ b/templates/default/invite.email_html.ep @@ -26,6 +26,11 @@

+<% if ($joinPassword && $joinPassword ne ''){ %> +

+ <%=l 'YOU_WILL_NEED_THIS_PASSWORD' %>: <%= $joinPassword %> +

+<% } %>

<%=l 'HAVE_A_NICE_MEETING' %> diff --git a/templates/default/invite.email_text.ep b/templates/default/invite.email_text.ep index 23f10a5..b513ec4 100644 --- a/templates/default/invite.email_text.ep +++ b/templates/default/invite.email_text.ep @@ -12,6 +12,10 @@ <%= $url . $room %> +<% if ($joinPassword && $joinPassword ne ''){ %> +<%=l 'YOU_WILL_NEED_THIS_PASSWORD' %>: <%== $joinPassword %> +<% } %> + <%=l 'HAVE_A_NICE_MEETING' %> -- <%=l 'EMAIL_SIGN' %>