"
+ recipients admin.email
+ subject formatted_subject("New registration")
+ body "domain" => server,
+ "url" => person_path(new_peep)
+ end
private
diff --git a/app/models/preference.rb b/app/models/preference.rb
index 930c61de..ba5db321 100644
--- a/app/models/preference.rb
+++ b/app/models/preference.rb
@@ -21,7 +21,7 @@ class Preference < ActiveRecord::Base
attr_accessible :app_name, :server_name, :domain, :smtp_server,
:exception_notification,
:email_notifications, :email_verifications, :analytics,
- :about, :demo, :whitelist, :gmail
+ :about, :demo, :whitelist, :gmail, :registration_notification
validates_presence_of :domain, :if => :using_email?
validates_presence_of :smtp_server, :if => :using_email?
diff --git a/app/views/admin/preferences/edit.html.erb b/app/views/admin/preferences/edit.html.erb
index 8100586e..2a6d6b21 100644
--- a/app/views/admin/preferences/edit.html.erb
+++ b/app/views/admin/preferences/edit.html.erb
@@ -73,6 +73,15 @@
+ Notify first admin for registrations
+
+
+ <%= f.check_box :registration_notification %>
+
+
+
+
- <%= display full_message.content %>
+ <%= display simple_format_without_paragraph full_message.content %>
Sent <%= time_ago_in_words full_message.created_at %> ago |
<%= link_to "Reply", reply_message_path(full_message) %> |
@@ -17,4 +17,4 @@
:method => :put %>
<% end -%>
-
\ No newline at end of file
+
diff --git a/app/views/person_mailer/registration_notification.html.erb b/app/views/person_mailer/registration_notification.html.erb
new file mode 100644
index 00000000..d860eb6e
--- /dev/null
+++ b/app/views/person_mailer/registration_notification.html.erb
@@ -0,0 +1,4 @@
+A new person has registered:
+
+http://<%= @domain %><%= @url %>
+
diff --git a/db/migrate/20081110045632_add_registration_notification_preferences.rb b/db/migrate/20081110045632_add_registration_notification_preferences.rb
new file mode 100644
index 00000000..48296d63
--- /dev/null
+++ b/db/migrate/20081110045632_add_registration_notification_preferences.rb
@@ -0,0 +1,9 @@
+class AddRegistrationNotificationPreferences < ActiveRecord::Migration
+ def self.up
+ add_column :preferences, :registration_notification, :boolean, :default => false
+ end
+
+ def self.down
+ remove_column :preferences, :registration_notification
+ end
+end