Add a custom message field in email invitations

Can be used to send the join password, or anything else
master
Daniel Berteaud 11 years ago
parent cea2189774
commit fdff058521
  1. 2
      lib/Vroom/I18N/en.pm
  2. 2
      lib/Vroom/I18N/fr.pm
  3. 8
      public/js/vroom.js
  4. 13
      public/vroom.pl
  5. 5
      templates/default/invite.email_html.ep
  6. 4
      templates/default/invite.email_text.ep
  7. 7
      templates/default/join.html.ep

@ -51,6 +51,8 @@ our %Lexicon = (
"YOU_CAN_INVITE_BY_MAIL" => "You can also directly send an invitation by email", "YOU_CAN_INVITE_BY_MAIL" => "You can also directly send an invitation by email",
"EMAIL_INVITE" => "Email invite", "EMAIL_INVITE" => "Email invite",
"SEND_INVITE" => "Send an email invitation", "SEND_INVITE" => "Send an email invitation",
"MESSAGE" => "Message",
"SEND_CUSTOM_MESSAGE" => "You can add a custom message, for example, the password needed to join this room",
"DISPLAY_NAME" => "Display name", "DISPLAY_NAME" => "Display name",
"YOUR_NAME" => "Your name", "YOUR_NAME" => "Your name",
"NAME_SENT_TO_OTHERS" => "This name will be sent to the other peers so they can identify you. You need to set your name before you can chat", "NAME_SENT_TO_OTHERS" => "This name will be sent to the other peers so they can identify you. You need to set your name before you can chat",

@ -55,6 +55,8 @@ our %Lexicon = (
"YOU_CAN_INVITE_BY_MAIL" => "Vous pouvez aussi envoyer une invitation directement par email", "YOU_CAN_INVITE_BY_MAIL" => "Vous pouvez aussi envoyer une invitation directement par email",
"SEND_INVITE" => "Envoyez une invitation par mail", "SEND_INVITE" => "Envoyez une invitation par mail",
"EMAIL_INVITE" => "Inviter par email", "EMAIL_INVITE" => "Inviter par email",
"MESSAGE" => "Message",
"SEND_CUSTOM_MESSAGE" => "Vous pouvez ajouter un message personnalisé, par exemple le mot de passe nécessaire pour rejoindre le salon",
"DISPLAY_NAME" => "Nom", "DISPLAY_NAME" => "Nom",
"YOUR_NAME" => "Votre nom", "YOUR_NAME" => "Votre nom",
"NAME_SENT_TO_OTHERS" => "Ce nom sera envoyé aux autres participants pour qu'ils puissent vous identifier. " . "NAME_SENT_TO_OTHERS" => "Ce nom sera envoyé aux autres participants pour qu'ils puissent vous identifier. " .

@ -128,7 +128,7 @@ function initVroom(room) {
} }
else{ else{
$('.ownerEl').hide(500); $('.ownerEl').hide(500);
if (data.auth == 'yes'){ if (data.owner_auth == 'yes'){
$('.unauthEl').show(500); $('.unauthEl').show(500);
} }
} }
@ -513,7 +513,8 @@ function initVroom(room) {
// Handle Email Invitation // Handle Email Invitation
$('#inviteEmail').submit(function(event) { $('#inviteEmail').submit(function(event) {
event.preventDefault(); event.preventDefault();
var rcpt = $('#recipient').val(); var rcpt = $('#recipient').val();
message = $('#message').val();
// Simple email address verification // Simple email address verification
if (!rcpt.match(/\S+@\S+\.\S+/)){ if (!rcpt.match(/\S+@\S+\.\S+/)){
$.notify(locale.ERROR_MAIL_INVALID, 'error'); $.notify(locale.ERROR_MAIL_INVALID, 'error');
@ -523,6 +524,7 @@ function initVroom(room) {
data: { data: {
action: 'invite', action: 'invite',
recipient: rcpt, recipient: rcpt,
message: message,
room: roomName room: roomName
}, },
error: function(data) { error: function(data) {
@ -531,7 +533,7 @@ function initVroom(room) {
}, },
success: function(data) { success: function(data) {
$.notify(data.msg, 'success'); $.notify(data.msg, 'success');
$('#recipient').val(''); $('#recipient,#message').val('');
} }
}); });
}); });

@ -470,7 +470,8 @@ post '/action' => sub {
) unless ($data); ) unless ($data);
if ($action eq 'invite'){ if ($action eq 'invite'){
my $rcpt = $self->param('recipient'); my $rcpt = $self->param('recipient');
my $message = $self->param('message');
$self->email( $self->email(
header => [ header => [
Subject => encode("MIME-Header", $self->l("EMAIL_INVITATION")), Subject => encode("MIME-Header", $self->l("EMAIL_INVITATION")),
@ -478,7 +479,8 @@ post '/action' => sub {
], ],
data => [ data => [
template => 'invite', template => 'invite',
room => $room, room => $room,
message => $message
], ],
) || ) ||
return $self->render( return $self->render(
@ -576,9 +578,10 @@ post '/action' => sub {
elsif ($action eq 'getRole'){ elsif ($action eq 'getRole'){
return $self->render( return $self->render(
json => { json => {
role => $self->session($room)->{role}, role => $self->session($room)->{role},
auth => ($data->{owner_password}) ? 'yes' : 'no', owner_auth => ($data->{owner_password}) ? 'yes' : 'no',
status => 'success' join_auth => ($data->{join_password}) ? 'yes' : 'no',
status => 'success'
}, },
); );
} }

@ -26,6 +26,11 @@
</h1> </h1>
</center> </center>
</p> </p>
<% if ($message && $message ne ''){ %>
<p>
<%= $message %>
</p>
<% } %>
<br> <br>
<p> <p>
<%=l 'HAVE_A_NICE_MEETING' %> <%=l 'HAVE_A_NICE_MEETING' %>

@ -12,6 +12,10 @@
<%= $url . $room %> <%= $url . $room %>
<% if ($message && $message ne ''){ %>
<%== $message %>
<% } %>
<%=l 'HAVE_A_NICE_MEETING' %> <%=l 'HAVE_A_NICE_MEETING' %>
-- --
<%=l 'EMAIL_SIGN' %> <%=l 'EMAIL_SIGN' %>

@ -42,6 +42,13 @@
</button> </button>
</span> </span>
</div> </div>
<div class="input-group">
<textarea id="message" name="message" class="form-control help" placeholder="<%=l 'MESSAGE' %>" data-toggle="tooltip" data-placement="bottom" title="<%=l 'SEND_CUSTOM_MESSAGE' %>"></textarea>
<span class="input-group-addon">
<span class="glyphicon glyphicon-envelope">
</span>
</span>
</div>
</form> </form>
</li> </li>
</ul> </ul>

Loading…
Cancel
Save