Some more email invitation refactoring

master
Daniel Berteaud 11 years ago
parent 1d8ad29190
commit f65932fee1
  1. 12
      lib/Mojolicious/Plugin/Mailer.pm
  2. 9
      lib/Vroom/I18N/en.pm
  3. 12
      lib/Vroom/I18N/fr.pm
  4. 1
      public/vroom.pl
  5. 22
      templates/default/invite.email_html.ep
  6. 10
      templates/default/invite.email_text.ep

@ -28,23 +28,25 @@ sub register {
Email::MIME->create( Email::MIME->create(
body => Encode::encode('UTF-8', $self->render( body => Encode::encode('UTF-8', $self->render(
@data, @data,
format => $args->{format} ? $args->{format} : 'email_html', format => $args->{format} ? $args->{format} : 'email_text',
partial => 1 partial => 1
)), )),
attributes => { attributes => {
charset => 'utf-8', charset => 'utf-8',
content_type => 'text/html', encoding => '7bit',
content_type => 'text/plain',
} }
), ),
Email::MIME->create( Email::MIME->create(
body => Encode::encode('UTF-8', $self->render( body => Encode::encode('UTF-8', $self->render(
@data, @data,
format => $args->{format} ? $args->{format} : 'email_text', format => $args->{format} ? $args->{format} : 'email_html',
partial => 1 partial => 1
)), )),
attributes => { attributes => {
charset => 'utf-8', charset => 'utf-8',
content_type => 'text/plain', encoding => '7bit',
content_type => 'text/html',
} }
), ),
); );
@ -64,7 +66,7 @@ sub register {
); );
$email->charset_set ( $args->{charset} ? $args->{charset} : 'utf-8' ); $email->charset_set ( $args->{charset} ? $args->{charset} : 'utf-8' );
$email->content_type_set( $args->{content_type} ? $args->{content_type} : 'text/html' ); $email->content_type_set( $args->{content_type} ? $args->{content_type} : 'multipart/alternative' );
return Email::Sender::Simple->try_to_send( $email, { transport => $transport } ) if $transport; return Email::Sender::Simple->try_to_send( $email, { transport => $transport } ) if $transport;

@ -12,9 +12,12 @@ our %Lexicon = (
"ERROR_NOT_LOGGED_IN" => "Sorry, your not logged in", "ERROR_NOT_LOGGED_IN" => "Sorry, your not logged in",
"EMAIL_INVITATION" => "Video conference invitation", "EMAIL_INVITATION" => "Video conference invitation",
"INVITE_SENT_TO_s" => "An invitation was sent to %s", "INVITE_SENT_TO_s" => "An invitation was sent to %s",
"TO_JOIN_CLICK_THIS_LINK" => "You're invited to join a video conference. " . "YOU_ARE_INVITED_TO_A_MEETING" => "You are awaited on a video conferecing room. " .
"All you need is a modern web browser and a webcam. When you're ready, " . "Before joining it, make sure you have all the necessary",
"just go to this address", "A_MODERN_BROWSER" => "A modern web browser, recent versions of Mozilla Firefox, Google Chrome or Opera will work",
"A_WEBCAM" => "A webcam",
"A_MIC" => "A microphone",
"WHEN_YOU_ARE_READY" => "When you are ready, go to this address to join the conference",
"HAVE_A_NICE_MEETING" => "Have a nice meeting :-)", "HAVE_A_NICE_MEETING" => "Have a nice meeting :-)",
"EMAIL_SIGN" => "VROOM! And video conferencing becomes free, simple and safe", "EMAIL_SIGN" => "VROOM! And video conferencing becomes free, simple and safe",
"FEEDBACK" => "Feedback", "FEEDBACK" => "Feedback",

@ -12,10 +12,14 @@ our %Lexicon = (
"ERROR_ROOM_s_LOCKED" => "Le salon %s est verrouillé, vous ne pouvez pas le rejoindre", "ERROR_ROOM_s_LOCKED" => "Le salon %s est verrouillé, vous ne pouvez pas le rejoindre",
"ERROR_OCCURED" => "Une erreur est survenue", "ERROR_OCCURED" => "Une erreur est survenue",
"ERROR_NOT_LOGGED_IN" => "Désolé, vous n'êtes pas identifié", "ERROR_NOT_LOGGED_IN" => "Désolé, vous n'êtes pas identifié",
"EMAIL_INVITATION" => "Vidéo conférence", "EMAIL_INVITATION" => "Invitation à une conférence vidéo",
"TO_JOIN_CLICK_THIS_LINK" => "Vous êtes attendu sur un salon de vidéo conférence. " . "YOU_ARE_INVITED_TO_A_MEETING" => "Vous êtes attendu sur un salon de vidéo conférence. " .
"Tout ce dont vous avez besoin est un navigateur web récent et " . "Avant de le rejoindre, assurez vous de disposer de tout le nécessaire",
"une webcam. Quand vous êtes prêt, rendez-vous sur cette adresse", "A_MODERN_BROWSER" => "Un navigateur web moderne, les versions récentes des navigateurs Mozilla " .
"Firefox, Google Chrome ou Opera fonctionneront",
"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",
"HAVE_A_NICE_MEETING" => "Bonne réunion :-)", "HAVE_A_NICE_MEETING" => "Bonne réunion :-)",
"EMAIL_SIGN" => "VROOM! Et la visio conférence devient libre, simple et sûr", "EMAIL_SIGN" => "VROOM! Et la visio conférence devient libre, simple et sûr",
"FEEDBACK" => "Retour d'expérience", "FEEDBACK" => "Retour d'expérience",

@ -381,7 +381,6 @@ post '/action' => sub {
Subject => encode("MIME-Header", $self->l("EMAIL_INVITATION")), Subject => encode("MIME-Header", $self->l("EMAIL_INVITATION")),
To => $rcpt To => $rcpt
], ],
content_type => 'multipart/alternative',
data => [ data => [
template => 'invite', template => 'invite',
room => $room room => $room

@ -1,14 +1,23 @@
<html>
<p>
<% <%
my $url = $self->url_for('/')->to_abs; my $url = $self->url_for('/')->to_abs;
$url .= ($url =~ m/\/$/) ? '' : '/'; $url .= ($url =~ m/\/$/) ? '' : '/';
%> %>
<%=
$self->l('TO_JOIN_CLICK_THIS_LINK');
%>
<br/>
<p> <p>
<%=l 'YOU_ARE_INVITED_TO_A_MEETING' %>
<ul>
<li>
<%=l 'A_MODERN_BROWSER' %>
</li>
<li>
<%=l 'A_WEBCAM' %>
</li>
<li>
<%=l 'A_MIC' %>
</li>
</ul>
</p>
<p>
<%=l 'WHEN_YOU_ARE_READY' %>
<center> <center>
<h1> <h1>
<a href="<%= $url . $room %>"> <a href="<%= $url . $room %>">
@ -26,4 +35,3 @@
<br> <br>
<%=l 'EMAIL_SIGN' %> <%=l 'EMAIL_SIGN' %>
</p> </p>
</html>

@ -2,9 +2,13 @@
my $url = $self->url_for('/')->to_abs; my $url = $self->url_for('/')->to_abs;
$url .= ($url =~ m/\/$/) ? '' : '/'; $url .= ($url =~ m/\/$/) ? '' : '/';
%> %>
<%= <%=l 'YOU_ARE_INVITED_TO_A_MEETING' %>
$self->l('TO_JOIN_CLICK_THIS_LINK')
%> * <%=l 'A_MODERN_BROWSER' %>
* <%=l 'A_WEBCAM' %>
* <%=l 'A_MIC' %>
<%=l 'WHEN_YOU_ARE_READY' %>
<%= $url . $room %> <%= $url . $room %>

Loading…
Cancel
Save