1 class AdminNotifier < ActionMailer::Base
2 include AbstractController::Callbacks
4 default from: Rails.configuration.admin_notifier_email_from
5 before_filter :load_variables
9 if not Rails.configuration.new_user_notification_recipients.empty? then
10 @recipients = Rails.configuration.new_user_notification_recipients
11 logger.info "Sending mail to #{@recipients} about new user #{@user.uuid} (#{@user.full_name} <#{@user.email}>)"
14 if Rails.configuration.auto_setup_new_users
15 add_to_subject = @user.is_invited ? 'and setup ' : ', but not setup '
19 subject: "#{Rails.configuration.email_subject_prefix}New user created #{add_to_subject}notification"
24 def new_inactive_user(user)
26 if not Rails.configuration.new_inactive_user_notification_recipients.empty? then
27 @recipients = Rails.configuration.new_inactive_user_notification_recipients
28 logger.info "Sending mail to #{@recipients} about new user #{@user.uuid} (#{@user.full_name} <#{@user.email}>)"
30 subject: "#{Rails.configuration.email_subject_prefix}New inactive user notification"
37 if Rails.configuration.respond_to?('workbench_address') and
38 not Rails.configuration.workbench_address.nil? and
39 not Rails.configuration.workbench_address.empty? then
40 @wb_address = Rails.configuration.workbench_address.sub(/\/$/,'') + '/users'