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 +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +5 -4
- data/app/models/development_notification/email.rb +9 -4
- data/lib/development_notification/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa8acdb52671206f355b55f8ba4ce31de3814aeb
|
4
|
+
data.tar.gz: b39316615517d9fd3fbf5c5a9684a299ce786b7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d14b5351eaae50c32b1fb6be4301d3150f62e0767a008ae0d0d5f62b68279435ce8ba7772e0451723f8cce7e6ad0a900d35d426cfdb1a94d40cd4d69d6fd59
|
7
|
+
data.tar.gz: 9b9c79718071ea829cc19730e7c4f2a040ce9b9f4acd9f102029109e0defb2e7499bb17ce29ec097e7546908cd508c97caa4789058ac4ee355c7d9e3845bf172
|
data/MIT-LICENSE
CHANGED
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.
|
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@
|
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:
|
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
|
-
|
15
|
-
|
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
|
-
|
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
|
|
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.
|
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-
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|