development_notification 0.1.2 → 0.1.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: 5c0cb7288d78ed2255ce13ccc53ac4a4e72d5480
4
- data.tar.gz: ef6a3ebd7c049e5943cc898acc8ac5f20e3a17b3
3
+ metadata.gz: fa8acdb52671206f355b55f8ba4ce31de3814aeb
4
+ data.tar.gz: b39316615517d9fd3fbf5c5a9684a299ce786b7d
5
5
  SHA512:
6
- metadata.gz: 590229d3386609fd7c520c75b8e680de69610a299b9d2c1cad40b39a66b580f13078fe79f490978c9f7502a7b601f371e93fd2f3195557845abfa1fa9fb2649a
7
- data.tar.gz: 1bc78c62465b83e8ecff81133df34383010c4a39a05636865778c8f43317d51d81be3edf3a001f472900ed69091f36780223c173c39aa99ac496ea19f0f5ffdc
6
+ metadata.gz: f8d14b5351eaae50c32b1fb6be4301d3150f62e0767a008ae0d0d5f62b68279435ce8ba7772e0451723f8cce7e6ad0a900d35d426cfdb1a94d40cd4d69d6fd59
7
+ data.tar.gz: 9b9c79718071ea829cc19730e7c4f2a040ce9b9f4acd9f102029109e0defb2e7499bb17ce29ec097e7546908cd508c97caa4789058ac4ee355c7d9e3845bf172
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2015 YOURNAME
1
+ Copyright 2015 Creative
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  ## Installation
4
4
 
5
- Point to this repo (or a fork) and bundle
6
5
  ```
7
- gem 'development_notification', "0.1.0", git: 'https://github.com/CreativePublisher/development_notification', branch: 'master'
6
+ gem 'development_notification', "0.1.3" # and bundle
8
7
  ```
9
8
 
10
9
  Copy and run migration
@@ -30,8 +29,10 @@ After setup you gain access to:
30
29
  * DevelopmentNotification::Email model that logs email prepared and sent.
31
30
  * DevelopmentNotification::Email.send_email(parameter_hash) #=> sends emails
32
31
 
33
- ### Email sending
34
- DevelopmentNotification::Email.send_email(title: "Systemside identifier", to: "dump@example.com", from: "creative@inbox.lv", fromname: "Creative", subject: "test", template: "html body")
32
+ ### Email sending :bear: (the good stuff) :honeybee:
33
+ DevelopmentNotification::Email.send_email(title: "Systemside identifier", to: ["dump@example1.com", "dump@example2.com"], from: "creative@inbox.lv", fromname: "Creative", subject: "test", template: "html body")
34
+
35
+ `to:` key accepts both array of strings and a single string
35
36
 
36
37
  ## Gotchas
37
38
  * Engine uses smart migration inclusion, this works well in development, but production deployment that migrates selectively (like mina) may fail at detecting migrations. Be sure to __force migration__ in production.
@@ -9,12 +9,17 @@ module DevelopmentNotification
9
9
  validates :subject, presence: true
10
10
  validates :status, presence: true
11
11
 
12
- def self.send_email(title: nil, to: nil, from: nil, fromname: nil, subject: nil, template: nil, template_path: nil, locals: nil)
12
+ def self.send_email(title: nil, to: [], from: nil, fromname: nil, subject: nil, template: nil, template_path: nil, locals: nil)
13
+ mail_object = nil
13
14
 
14
- mailer = Leadersend::Mail.new(title: title, to: to, from: from, fromname: fromname, subject: subject, template: template)
15
- leadersend_response_hash = mailer.send
15
+ [to].flatten.each do |to_email|
16
+ mailer = Leadersend::Mail.new(title: title, to: to_email, from: from, fromname: fromname, subject: subject, template: template)
17
+ leadersend_response_hash = mailer.send
16
18
 
17
- mail_object = DevelopmentNotification::Email.create_from_leadersend_response_hash(leadersend_response_hash)
19
+ mail_object = DevelopmentNotification::Email.create_from_leadersend_response_hash(leadersend_response_hash)
20
+ puts "sent email to '#{to_email}'"
21
+
22
+ end
18
23
 
19
24
  return mail_object
20
25
 
@@ -1,3 +1,3 @@
1
1
  module DevelopmentNotification
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: development_notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Creative
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-21 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails