simply_notify 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4fd5c39e89d9d8383fc28ceb06e1cfd5b912fd2
4
- data.tar.gz: 368fc3d3dd49c55f543c2ddbea951f3250a2bd2e
3
+ metadata.gz: c364f5e1904b988610dfbb5988ce6c646ca5b689
4
+ data.tar.gz: 3c7b495b7f63910b965bcf60c956cb18c9d00ab9
5
5
  SHA512:
6
- metadata.gz: f1359313017d8e09e441c7bb5ef9f0337842943f318efed1e7a359628cd5249194f5f8c521ec13618066a3e77c463dfdb6ec1da09de345f91ac6f51fa85f9ae2
7
- data.tar.gz: 40facb99fcd5c198b1fe13a37500197f7d5c360800c53e57f503a699388737694bdf1e9f6027aa4ecd8fc78fe262b1031900117140449311931d802a9596e8ea
6
+ metadata.gz: b4d405c06dd02f4b1dcd4dab65a4c4794310a42fa5e85a41f25dca1411eba9d75ff33fe9c8000287da5c6723b894a1f0d51aa50243e093f499cdb75ed1af66ba
7
+ data.tar.gz: 60bbf29a5e8535422df72f0e41d24d311c51f761c9b855bd77db9612b2e1581e9261864b531bf576b8f3ba3a17bb2e366e8a8e40534d0f9a1e198ea705dd4035
data/README.md CHANGED
@@ -26,32 +26,10 @@ Create the model and views using the generator:
26
26
 
27
27
  rails generate notifier
28
28
 
29
- In the views (text and html respectively), place a message such as this:
30
-
31
- Hello <%= @recipient %>,
32
- You have a new notification! Please visit the course website.
33
- Thanks.
34
-
35
- AND
36
-
37
- <!DOCTYPE html>
38
- <html>
39
- <head>
40
- <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
41
- </head>
42
- <body>
43
- <h1>Hello <%= @user.name %></h1>
44
- <p>
45
- You have a new notification! Please visit the course website.<br>
46
- Thanks.<br>
47
- </p>
48
- </body>
49
- </html>
50
-
51
-
52
- Finally, call a variation of this from the controller where notifications are created, right after the notifcation is saved:
53
-
54
- Notifier.new_notification(@recipient).deliver_now
29
+
30
+ Place a call in the controller where notifications are created, after the notifcation is saved:
31
+
32
+ Notifier.new_notification(@user).deliver_now
55
33
 
56
34
 
57
35
  ## Contributing
@@ -5,14 +5,30 @@ class NotifierGenerator < Rails::Generators::Base
5
5
  desc "This generator creates the Model and Views"
6
6
 
7
7
  def create_model_file
8
- create_file "models/notifier.rb", "require 'simply_notify'"
8
+ create_file "app/models/notifier.rb", "require 'simply_notify'"
9
9
  end
10
10
 
11
11
  def create_html_view_file
12
- create_file "views/notifier/html.html.erb", "# Put html here"
12
+ create_file "app/views/notifier/new_notification.html.erb",
13
+ "<!DOCTYPE html>
14
+ <html>
15
+ <head>
16
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
17
+ </head>
18
+ <body>
19
+ <h1>Hello <%= @recipient %></h1>
20
+ <p>
21
+ You have a new notification! Please visit the course website.<br>
22
+ Thanks.<br>
23
+ </p>
24
+ </body>
25
+ </html>"
13
26
  end
14
27
 
15
28
  def create_text_view_file
16
- create_file "views/notifier/text.html.erb", "# Put text here"
29
+ create_file "app/views/notifier/new_notification.text.erb",
30
+ "Hello <%= @recipient %>,
31
+ You have a new notification! Please visit the course website.
32
+ Thanks."
17
33
  end
18
34
  end
data/lib/simply_notify.rb CHANGED
@@ -6,7 +6,7 @@ class Notifier < ActionMailer::Base
6
6
 
7
7
  def new_notification(recipient)
8
8
  @recipient = recipient
9
- mail(:to => recipient,
9
+ mail(:to => recipient.email,
10
10
  :subject => 'New Notification',
11
11
  :content_type => 'text/html')
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module SimplyNotify
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simply_notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Lichten
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-28 00:00:00.000000000 Z
11
+ date: 2016-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer