Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #103 from sul-dlss/user-notification-changes
Browse files Browse the repository at this point in the history
setup auto puring of inactive/unconfirmed users via cron; update text…
  • Loading branch information
peetucket authored Dec 21, 2017
2 parents 868c506 + ec8ccb4 commit faf0d2c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class User < ActiveRecord::Base
before_save :trim_names
after_create :signup_for_mailing_list, :if=>lambda{subscribe_to_mailing_list=='1'}
after_create :create_default_favorites_list # create the default favorites list when accounts are created
after_create :inactivate_account, :if=>lambda{Revs::Application.config.require_manual_account_activation == true}
after_create :inactivate_account, :if=>lambda{Revs::Application.config.require_manual_account_activation == true && !sunet_user?}
after_save :create_default_favorites_list # create the default favorites list if it doesn't exist when a user logs in

validate :check_role_name
Expand Down
2 changes: 1 addition & 1 deletion app/views/revs_mailer/new_users_notification.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<meta charset="utf-8" />
</head>
<body>
<p><%=@num_users%> users have registered on the Automobility Archive and require activation.</p>
<p><%=@num_users%> users have registered on the Automobility Archive and require activation. Visit <a href="https://automobility.stanford.edu/admin/users?filter_status=inactive_new">the admin interface</a> to approve.</p>
</body></html>
13 changes: 11 additions & 2 deletions config/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@

if ['production','staging'].include? @environment

every 5.days, :at => '1:00 am' do
every 5.days, :at => '12:00 am' do
rake "blacklight:delete_old_searches[5]"
end

every 1.days, :at => '1:00 am' do
rake "revs:notify_new_registrations"
end

every 1.days, :at => '2:00 am' do
rake "users:purge_unconfirmed_users"
end

every 1.days, :at => '3:00 am' do
rake "users:purge_inactive_users"
end


end

if ['production'].include? @environment
Expand All @@ -18,4 +27,4 @@
rake "-s sitemap:refresh"
end

end
end

0 comments on commit faf0d2c

Please sign in to comment.