Add flag to enable/disable mail notifications

This commit is contained in:
Leonardo Crauss Daronco
2016-12-08 18:55:41 -02:00
parent e94f3d7a10
commit f763d8394e
3 changed files with 40 additions and 32 deletions

View File

@ -171,8 +171,10 @@ class BbbController < ApplicationController
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?
if Rails.configuration.mail_notifications
owner = User.find_by(encrypted_id: token)
RecordingReadyEmailJob.perform_later(owner) if owner.present?
end
# 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