1 class AdminNotifier < ActionMailer::Base
2 include AbstractController::Callbacks
4 default from: Rails.configuration.admin_notifier_email_from
8 if not Rails.configuration.new_user_notification_recipients.empty? then
9 @recipients = Rails.configuration.new_user_notification_recipients
10 logger.info "Sending mail to #{@recipients} about new user #{@user.uuid} (#{@user.full_name} <#{@user.email}>)"
13 if Rails.configuration.auto_setup_new_users
14 add_to_subject = @user.is_invited ? ' and setup' : ', but not setup'
18 subject: "#{Rails.configuration.email_subject_prefix}New user created#{add_to_subject} notification"
23 def new_inactive_user(user)
25 if not Rails.configuration.new_inactive_user_notification_recipients.empty? then
26 @recipients = Rails.configuration.new_inactive_user_notification_recipients
27 logger.info "Sending mail to #{@recipients} about new user #{@user.uuid} (#{@user.full_name} <#{@user.email}>)"
29 subject: "#{Rails.configuration.email_subject_prefix}New inactive user notification"