simply_notify 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d59702c28da1b3eb60ba0fbfba431c233c5b480e
4
- data.tar.gz: 3fddbf19e496b6c120096c7018a588385c1cf6f6
3
+ metadata.gz: cc5b4244495f2ac47c52152ec79694745257fd34
4
+ data.tar.gz: d95a4cdb60ea6fcf69f9d39a166bb1eb17931174
5
5
  SHA512:
6
- metadata.gz: 5fdc6b7bf85ee34fa32e69be958acb34793bcfd4823faedeadb6569b2576cc15191854891b2a78a0fe5ce396df5eb6fd35452ce52ca93864ea193763a1dce72b
7
- data.tar.gz: de74be575dabd5f55868f5dbc5c618b2213cd828265cc5b43a87ec73e4658affa6f5cdae1305116c5103c14293f0929e20250e7d16fcf2ce9a28e986f523cf68
6
+ metadata.gz: 57c11f7cfbd7bfe25d08193ba4044c0ac41865a26cc4c1d9634840fcc3e70fa2555cca40fdfb01ffc5b7b959e4aa4f25438d73bbae4b60afa5b12eccda3f4447
7
+ data.tar.gz: 4388741dd0e97054231051e609fa0a170bdac345bc0ba4beafa566a448b132c7224a2d13393dbda0a6f5bdfc881fd4f57277f78ac6b09a3dbc9d3cd8598db7b4
data/README.md CHANGED
@@ -27,7 +27,7 @@ Create the model and views using the generator:
27
27
  rails generate notifier
28
28
 
29
29
 
30
- Place a call in the controller where notifications should be created to loop through users emails, after the notifcation is saved:
30
+ Place a call in the controller in which you want notifications to be created. For example, if you want each user to be notified when an assignment is created, use a call such as this:
31
31
 
32
32
  @users = User.all
33
33
  @users.each do |u|
@@ -35,6 +35,21 @@ Place a call in the controller where notifications should be created to loop thr
35
35
  end
36
36
 
37
37
 
38
+ Add config SMTP code to appropriate environments. For example, sending emails from a gmail account:
39
+
40
+ # SMTP Config
41
+ config.action_mailer.delivery_method = :smtp
42
+ config.action_mailer.perform_deliveries = true
43
+ config.action_mailer.smtp_settings = {
44
+ address: 'smtp.gmail.com',
45
+ port: 587,
46
+ domain: 'gmail.com',
47
+ user_name: 'YOUR_USERNAME@gmail.com',
48
+ password: 'YOUR_PASSWORD',
49
+ authentication: 'plain',
50
+ enable_starttls_auto: true }
51
+
52
+
38
53
  ## Contributing
39
54
 
40
55
  Bug reports and pull requests are welcome on GitHub at https://github.com/tylerlichten/simply_notify.
@@ -5,7 +5,7 @@ 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 "app/models/notifier.rb", "require 'simply_notify'"
8
+ create_file "app/mailers/notifier.rb", "require 'simply_notify'"
9
9
  end
10
10
 
11
11
  def create_html_view_file
@@ -16,9 +16,9 @@ class NotifierGenerator < Rails::Generators::Base
16
16
  <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
17
17
  </head>
18
18
  <body>
19
- <h1>Hello <%= @recipient %></h1>
19
+ <h1>Hello</h1>
20
20
  <p>
21
- You have a new notification! Please visit the course website.<br>
21
+ A new assignment has been posted! Please visit the course website.<br>
22
22
  Thanks.<br>
23
23
  </p>
24
24
  </body>
@@ -27,8 +27,8 @@ class NotifierGenerator < Rails::Generators::Base
27
27
 
28
28
  def create_text_view_file
29
29
  create_file "app/views/notifier/new_notification.text.erb",
30
- "Hello <%= @recipient %>,
31
- You have a new notification! Please visit the course website.
30
+ "Hello,
31
+ A new assignment has been posted! Please visit the course website.
32
32
  Thanks."
33
33
  end
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module SimplyNotify
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
data/lib/simply_notify.rb CHANGED
@@ -2,12 +2,10 @@ require "simply_notify/version"
2
2
  require "action_mailer"
3
3
 
4
4
  class Notifier < ActionMailer::Base
5
- default from: 'no-reply@brandeis.edu'
5
+ default from: 'brandeisapprenticeship@gmail.com'
6
6
 
7
7
  def new_notification(recipient)
8
- @recipient = recipient
9
- mail(to: @recipient.email,
10
- subject: 'New Notification',
11
- content_type: 'text/html')
8
+ mail(to: recipient,
9
+ subject: 'New Notification')
12
10
  end
13
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simply_notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Lichten