mailboxer 0.10.2 → 0.10.3

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: f6f8c3c1cb117883b23f63dcd0b539cbc96f0e63
4
- data.tar.gz: 4ca5f945d183d2eed59d4404e8bcf4d9a8873a4d
3
+ metadata.gz: bd3c7b425e191ba6788668307d71c0a472d0db03
4
+ data.tar.gz: f9910f2a5eae2f12f4daf3a56c5654b89bf8e716
5
5
  SHA512:
6
- metadata.gz: 10c3c296350557ad682836ebbabde11dd81956efa0895b62f29523a9d7017cce65ea17c312cc0e639483253ae3d44cc43173e6ee94f0083e969df1d94c00bdf6
7
- data.tar.gz: 0288431615ef22cd4541c945e007676f9dda03dbe843055f63d7267c36baa2ec98f2481b1d80f58e2e160cc4442b0e931009710d72835895f592b6c88b1b77b2
6
+ metadata.gz: a0fcdb2b6596e63d82183fbf73f758fb0755bfe2afe1c7e9939a041e35b2959c37bcfa41aceecac62314d16967bf6e77a9dd628d7d7c58361a34b76d82e603d5
7
+ data.tar.gz: c3ab6f97dfaf4dd8b808cd52f8c66551a576a554231c0a6142d7d37b715e4c04abcc14eb1f7c71ea3590ed494b03de21990cc8834a45f9b6c32c3fb6c3874ce9
@@ -29,13 +29,13 @@ class Notification < ActiveRecord::Base
29
29
 
30
30
  class << self
31
31
  #Sends a Notification to all the recipients
32
- def notify_all(recipients,subject,body,obj = nil,sanitize_text = true,notification_code=nil)
32
+ def notify_all(recipients,subject,body,obj = nil,sanitize_text = true,notification_code=nil,send_mail=true)
33
33
  notification = Notification.new({:body => body, :subject => subject})
34
34
  notification.recipients = recipients.respond_to?(:each) ? recipients : [recipients]
35
35
  notification.recipients = notification.recipients.uniq if recipients.respond_to?(:uniq)
36
36
  notification.notified_object = obj if obj.present?
37
37
  notification.notification_code = notification_code if notification_code.present?
38
- return notification.deliver sanitize_text
38
+ return notification.deliver sanitize_text, send_mail
39
39
  end
40
40
 
41
41
  #Takes a +Receipt+ or an +Array+ of them and returns +true+ if the delivery was
@@ -73,7 +73,7 @@ class Notification < ActiveRecord::Base
73
73
 
74
74
  #Delivers a Notification. USE NOT RECOMENDED.
75
75
  #Use Mailboxer::Models::Message.notify and Notification.notify_all instead.
76
- def deliver(should_clean = true)
76
+ def deliver(should_clean = true, send_mail = true)
77
77
  self.clean if should_clean
78
78
  temp_receipts = Array.new
79
79
  #Receiver receipts
@@ -91,7 +91,7 @@ class Notification < ActiveRecord::Base
91
91
  #Should send an email?
92
92
  if Mailboxer.uses_emails
93
93
  email_to = r.send(Mailboxer.email_method,self)
94
- unless email_to.blank?
94
+ if send_mail && !email_to.blank?
95
95
  get_mailer.send_email(self,r).deliver
96
96
  end
97
97
  end
@@ -47,8 +47,8 @@ module Mailboxer
47
47
  end
48
48
 
49
49
  #Sends a notification to the messageable
50
- def notify(subject,body,obj = nil,sanitize_text=true,notification_code=nil)
51
- return Notification.notify_all([self],subject,body,obj,sanitize_text,notification_code)
50
+ def notify(subject,body,obj = nil,sanitize_text=true,notification_code=nil,send_mail=true)
51
+ return Notification.notify_all([self],subject,body,obj,sanitize_text,notification_code,send_mail)
52
52
  end
53
53
 
54
54
  #Sends a messages, starting a new conversation, with the messageable
data/mailboxer.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "mailboxer"
3
- s.version = "0.10.2"
3
+ s.version = "0.10.3"
4
4
  s.authors = ["Eduardo Casanova Cuesta"]
5
5
  s.summary = "Messaging system for rails apps."
6
6
  s.description = "A Rails engine that allows any model to act as messageable, adding the ability to exchange messages " +
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailboxer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Casanova Cuesta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-11 00:00:00.000000000 Z
11
+ date: 2013-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreigner