1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class AdminNotifier < ActionMailer::Base
6 include AbstractController::Callbacks
8 default from: Rails.configuration.Users.AdminNotifierEmailFrom
12 if not Rails.configuration.Users.NewUserNotificationRecipients.empty? then
13 @recipients = Rails.configuration.Users.NewUserNotificationRecipients.keys
14 logger.info "Sending mail to #{@recipients} about new user #{@user.uuid} (#{@user.full_name} <#{@user.email}>)"
17 if Rails.configuration.Users.AutoSetupNewUsers
18 add_to_subject = @user.is_invited ? ' and setup' : ', but not setup'
22 subject: "#{Rails.configuration.Users.EmailSubjectPrefix}New user created#{add_to_subject} notification"
27 def new_inactive_user(user)
29 if not Rails.configuration.Users.NewInactiveUserNotificationRecipients.empty? then
30 @recipients = Rails.configuration.Users.NewInactiveUserNotificationRecipients.keys
31 logger.info "Sending mail to #{@recipients} about new user #{@user.uuid} (#{@user.full_name} <#{@user.email}>)"
33 subject: "#{Rails.configuration.Users.EmailSubjectPrefix}New inactive user notification"