self.generic_callback('after_create', model, *args)
end
+ def new_inactive_user(user)
+ @user = user
+ if not Rails.configuration.new_inactive_user_notification_recipients.empty? then
+ mail(to: Rails.configuration.new_inactive_user_notification_recipients, subject: 'New inactive user notification')
+ end
+ end
+
protected
def generic_callback(callback_type, model, *args)
before_update :prevent_inactive_admin
before_create :check_auto_admin
after_create :add_system_group_permission_link
+ after_create :send_admin_notifications
after_create AdminNotifier
has_many :authorized_keys, :foreign_key => :authorized_user_uuid, :primary_key => :uuid
head_uuid: self.uuid)
end
end
+
+ def send_admin_notifications
+ if not self.is_active then
+ AdminNotifier.new_inactive_user(self).deliver
+ end
+ end
end
--- /dev/null
+
+A new user landed on the inactive user page:
+
+ <%= @user.full_name %> <<%= @user.email %>>
+
+Thanks,
+Your friendly Arvados robot.
admin_notifier_email_from: arvados@example.com
email_subject_prefix: "[ARVADOS] "
user_notifier_email_from: arvados@example.com
+ new_inactive_user_notification_recipients: ''
# Visitors to the API server will be redirected to the workbench
workbench_address: https://workbench.local:3001/