Send an email to the user when a recording is done processing

Had to add an email attribute to users to store their email to send the
notification. Will only send it for user rooms since they are the only
ones we know who to notify.
This commit is contained in:
Leonardo Crauss Daronco
2016-12-08 18:33:19 -02:00
parent 09c30bb5bd
commit e94f3d7a10
12 changed files with 161 additions and 7 deletions

View File

@ -170,9 +170,13 @@ class BbbController < ApplicationController
rec_info = rec_info[:recordings].first
RecordingCreatedJob.perform_later(token, parse_recording_for_view(rec_info))
# send an email to the owner of this recording, if defined
owner = User.find_by(encrypted_id: token)
RecordingReadyEmailJob.perform_later(owner) if owner.present?
# TODO: remove the webhook now that the meeting and recording are done
# remove only if the meeting is not running, otherwise the hook is needed
# if ENV['GREENLIGHT_USE_WEBHOOKS']
# if Rails.configuration.use_webhooks
# webhook_remove("#{base_url}/callback")
# end
else