Merge branch '2800-python-global-state' into 2800-pgs
[arvados.git] / services / api / app / mailers / admin_notifier.rb
index 871c9019467061bf4a6383ffe491a1ddd4ea8c18..e17f4a14dab2d05f16780b09a76844401ad3cbff 100644 (file)
@@ -1,5 +1,8 @@
 class AdminNotifier < ActionMailer::Base
+  include AbstractController::Callbacks
+
   default from: Rails.configuration.admin_notifier_email_from
+  before_filter :load_variables
 
   def new_user(user)
     @user = user
@@ -23,4 +26,15 @@ class AdminNotifier < ActionMailer::Base
     end
   end
 
+private
+  def load_variables
+    if Rails.configuration.respond_to?('workbench_address') and
+       not Rails.configuration.workbench_address.nil? and
+       not Rails.configuration.workbench_address.empty? then
+      @wb_address = Rails.configuration.workbench_address.sub(/\/$/,'') + '/users'
+    else
+      @wb_address = ''
+    end
+  end
+
 end