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/")) %>