simply_notify 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -12
- data/lib/simply_notify/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e88dd5e3fe506377dba0d46d39a6243efbb859d
|
4
|
+
data.tar.gz: 8a920ef6ae35991ae88549224b9a25fb88c2f5a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa795b5c74590a1fad451764493eb2c223927ced56b6eda54b77dc1c9bb86e82b08e0a91cc599882abe377cc9bffc6022ec0918150ef1a03034a12413f233207
|
7
|
+
data.tar.gz: 07548eae61fccfe0b16624b5a5ed19b676ffdf6195bd6203b09baf0cde6a89ea8b573de5de52bd8020ec1508e89f3e1e1344d0f14d291b7b285dfaea4c7d1cc3
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SimplyNotify
|
2
2
|
|
3
|
-
simply_notify allows users to set preferences on how they want to receive notifications. Notifications are sent to users via email using actionmailer. Users can set their account preferences to receive notifications either in real time or a list of notifications every 24 hours. Ahoy_email is used for email tracking. For more information on gem dependncies of simply_notify, check out the additional information section.
|
3
|
+
simply_notify allows users to set preferences on how they want to receive notifications. Notifications are sent to users via email using actionmailer. Users can set their account preferences to receive notifications either in real time or a list of notifications every 24 hours. Ahoy_email is used for email tracking. Depends on Devise for user authentication. For more information on gem dependncies of simply_notify, check out the additional information section.
|
4
4
|
|
5
5
|
# Installation
|
6
6
|
|
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
###Step 1
|
24
24
|
|
25
|
-
Generate mailer, views, and ahoy_email initializer.
|
25
|
+
Generate mailer, email views, and ahoy_email initializer.
|
26
26
|
|
27
27
|
$ rails generate notifier
|
28
28
|
|
@@ -35,28 +35,28 @@ Generate ahoy_messages table.
|
|
35
35
|
|
36
36
|
###Step 3
|
37
37
|
|
38
|
-
|
38
|
+
Add column to User table for notification frequency.
|
39
39
|
|
40
40
|
$ rails g migration add_notificationFrequency_to_users notifificationFrequency:integer
|
41
41
|
$ rake db:migrate
|
42
42
|
|
43
|
-
notificationFrequency values:
|
44
|
-
nil or 0 = user does not receive notifications via email
|
45
|
-
1 = user receives notifications in real time via email
|
43
|
+
notificationFrequency values:
|
44
|
+
nil or 0 = user does not receive notifications via email
|
45
|
+
1 = user receives notifications in real time via email
|
46
46
|
2 = user receives a list of notifications every 24 hours via email
|
47
47
|
|
48
48
|
###Step 4
|
49
49
|
|
50
|
-
Generate
|
50
|
+
Generate Notification model.
|
51
51
|
|
52
52
|
$ rails g model Notification recipient_id:integer creator_id:integer action:string url:string
|
53
53
|
$ rake db:migrate
|
54
54
|
|
55
55
|
###Step 5
|
56
56
|
|
57
|
-
Generate
|
57
|
+
Generate Notification controller.
|
58
58
|
|
59
|
-
$
|
59
|
+
$ rails g controller notifications
|
60
60
|
|
61
61
|
###Step 6
|
62
62
|
|
@@ -67,7 +67,7 @@ Generate config/schedule.rb for cron jobs.
|
|
67
67
|
|
68
68
|
###Step 7
|
69
69
|
|
70
|
-
Add create
|
70
|
+
Add Notification.create and Notifier.new_notification to the create method in appropriate controllers, such as this example in controllers/assignments_controller.rb.
|
71
71
|
|
72
72
|
if Assignment.where(:id) != nil
|
73
73
|
most_recent_id = Assignment.maximum(:id).next
|
@@ -151,7 +151,7 @@ Setup cron job frequency in config/schedule.rb.
|
|
151
151
|
rake "cron:deliver_emails"
|
152
152
|
end
|
153
153
|
|
154
|
-
Create file as lib/tasks/cron.rake and
|
154
|
+
Create file as lib/tasks/cron.rake and setup cron rake.
|
155
155
|
|
156
156
|
namespace :cron do
|
157
157
|
desc "Send notification emails every 24 hours"
|
@@ -188,7 +188,7 @@ Add route to config/routes.rb.
|
|
188
188
|
|
189
189
|
Add to notifications controller.
|
190
190
|
|
191
|
-
|
191
|
+
class NotificationsController < ApplicationController
|
192
192
|
before_action :authenticate_user!
|
193
193
|
|
194
194
|
def index
|