diff --git a/app/controllers/bbb_controller.rb b/app/controllers/bbb_controller.rb index a438d5d1..e5acec6e 100644 --- a/app/controllers/bbb_controller.rb +++ b/app/controllers/bbb_controller.rb @@ -215,7 +215,7 @@ class BbbController < ApplicationController # send an email to the owner of this recording, if defined if Rails.configuration.mail_notifications owner = User.find_by(encrypted_id: room_id) - RecordingReadyEmailJob.perform_later(owner) if owner.present? + RecordingReadyEmailJob.perform_later(owner, parse_recording_for_view(rec_info)) if owner.present? end # TODO: remove the webhook now that the meeting and recording are done diff --git a/app/jobs/recording_ready_email_job.rb b/app/jobs/recording_ready_email_job.rb index 465f0f38..cafcd99e 100644 --- a/app/jobs/recording_ready_email_job.rb +++ b/app/jobs/recording_ready_email_job.rb @@ -17,9 +17,9 @@ class RecordingReadyEmailJob < ApplicationJob queue_as :default - def perform(user) + def perform(user, rec) if user.email.present? - NotificationMailer.recording_ready_email(user).deliver + NotificationMailer.recording_ready_email(user, rec).deliver end end end diff --git a/app/lib/bbb_api.rb b/app/lib/bbb_api.rb index 82a5fe22..11cd1a63 100644 --- a/app/lib/bbb_api.rb +++ b/app/lib/bbb_api.rb @@ -257,7 +257,8 @@ module BbbApi length: recording[:length], listed: recording[:listed], playbacks: playbacks, - previews: previews + previews: previews, + participants: recording[:participants] } end diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index f4e288eb..0644a12b 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -17,8 +17,9 @@ class NotificationMailer < ActionMailer::Base default from: Rails.configuration.smtp_from - def recording_ready_email(user) + def recording_ready_email(user, rec) @user = user + @recording = rec @room_url = meeting_room_url(resource: 'rooms', id: user.encrypted_id) unless @room_url.include? "#{Rails.configuration.relative_url_root}/" @room_url = @room_url.split('/rooms/').join("#{Rails.configuration.relative_url_root}/rooms/") diff --git a/app/views/notification_mailer/recording_ready_email.html.erb b/app/views/notification_mailer/recording_ready_email.html.erb index b3def5d8..46d399fe 100644 --- a/app/views/notification_mailer/recording_ready_email.html.erb +++ b/app/views/notification_mailer/recording_ready_email.html.erb @@ -21,6 +21,37 @@

<%= t('.hi', name: @user.name) %>

<%= t('.phrase1') %>

-

<%= t('.phrase2', url: @room_url) %>

+ + + + + + + + + + + + + + + + + + + + + +
<%= t('.table.name') %><%= @recording[:name] %>
<%= t('.table.length') %><%= t('.table.length_value', value: @recording[:length]) %>
<%= t('.table.started') %><%= Time.parse(@recording[:start_time]).utc %>
<%= t('.table.ended') %><%= Time.parse(@recording[:end_time]).utc %>
<%= t('.table.users') %><%= @recording[:participants] %>
+

<%= t('.phrase2') %>

+

<%= link_to(@recording[:playbacks][0][:url], @recording[:playbacks][0][:url]) %>

+

<%= t('.phrase3_html') %>

+

<%= t('.phrase4') %>

+

<%= link_to(@room_url, @room_url) %>

+

<%= t('.phrase5') %>

+

<%= t('.closing') %>

+ -- +

<%= t('.footer.phrase1') %>

+

<%= t('.footer.phrase2_html', url: link_to("http://bigbluebutton.org/", "http://bigbluebutton.org/")) %>

diff --git a/config/locales/en-us.yml b/config/locales/en-us.yml index 6220d31c..4bb3fa33 100644 --- a/config/locales/en-us.yml +++ b/config/locales/en-us.yml @@ -107,10 +107,24 @@ en-US: no: No notification_mailer: recording_ready_email: + closing: "Regards,... BigBlueButton" + footer: + phrase1: This e-mail is auto-generated by your friendly neighbourhood BigBlueButton server. Do no reply to this e-mail. + phrase2_html: BigBlueButton is an open source web conferencing system. For more information on BigBlueButton and it's amazing capabilities, see %{url}. hi: "Hi, %{name}" - phrase1: "One of your recordings has just been made available." - phrase2: "Access the following website to view it and publish to other users: %{url}" + phrase1: "This is an e-mail notification that your recording for the session is ready." + phrase2: "Here's the direct link to the recording" + phrase3_html: "This recording is currently unlisted, which means only users with the above direct link can view the recording." + phrase4: "To make this recording public for everyone, visit" + phrase5: "and change its visibility from unlisted to public. After the recording is public, anyone with the above URL can view it." subject: "Your recording is ready!" + table: + ended: Ended + name: Name + length: Length + length_value: "%{value} minutes" + started: Started + users: Users participants: Users past_recordings: Past Recordings presentation: Presentation