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. 6
      public/js/vroom.js
  4. 5
      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",
"EMAIL_INVITE" => "Email invite",
"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",
"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",

@ -55,6 +55,8 @@ our %Lexicon = (
"YOU_CAN_INVITE_BY_MAIL" => "Vous pouvez aussi envoyer une invitation directement par email",
"SEND_INVITE" => "Envoyez une invitation par mail",
"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",
"YOUR_NAME" => "Votre nom",
"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{
$('.ownerEl').hide(500);
if (data.auth == 'yes'){
if (data.owner_auth == 'yes'){
$('.unauthEl').show(500);
}
}
@ -514,6 +514,7 @@ function initVroom(room) {
$('#inviteEmail').submit(function(event) {
event.preventDefault();
var rcpt = $('#recipient').val();
message = $('#message').val();
// Simple email address verification
if (!rcpt.match(/\S+@\S+\.\S+/)){
$.notify(locale.ERROR_MAIL_INVALID, 'error');
@ -523,6 +524,7 @@ function initVroom(room) {
data: {
action: 'invite',
recipient: rcpt,
message: message,
room: roomName
},
error: function(data) {
@ -531,7 +533,7 @@ function initVroom(room) {
},
success: function(data) {
$.notify(data.msg, 'success');
$('#recipient').val('');
$('#recipient,#message').val('');
}
});
});

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

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

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

@ -42,6 +42,13 @@
</button>
</span>
</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>
</li>
</ul>

Loading…
Cancel
Save