mandrillamelo 0.1.0 → 0.2.0
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/mandrillamelo +15 -10
- 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: 4f5485e59a35a6174ee5ab42ed04e3f5cc30bd98
|
|
4
|
+
data.tar.gz: 3a872346625826590decb12360db98cc0259cb50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bce3526b962a114c4188e893bb1c02a5dca94f91f4da0a87951bb076bf8d881b3561c34d200369e40f896ce2a7ac08eee8ea7a2b1b3b4c9fd538a358e3ac3769
|
|
7
|
+
data.tar.gz: eaa6aa2989fc9237ff1d8423b3ad1b95d38d7710ba23aebf60f93ae05392d2b77fb92e60fb1b1b2f2485b37ce62485bc9853ef1b8677e8e12703ef8796d8cbce
|
data/mandrillamelo
CHANGED
|
@@ -7,28 +7,26 @@ parser = Vandamme::Parser.new(changelog: changelog, version_header_exp: '(\d\.\d
|
|
|
7
7
|
|
|
8
8
|
last_release = parser.to_html.keys[0]
|
|
9
9
|
|
|
10
|
-
def send_mail(release, html_changelog)
|
|
10
|
+
def send_mail(app_name, release, html_changelog, to, from, api_key, headers = {})
|
|
11
11
|
begin
|
|
12
|
-
|
|
13
|
-
mandrill = Mandrill::API.new(ENV['MANDRILL_KEY'])
|
|
12
|
+
mandrill = Mandrill::API.new(api_key)
|
|
14
13
|
message = {
|
|
15
14
|
"tags"=>["changelog"],
|
|
16
15
|
"to"=> to,
|
|
17
16
|
"track_opens"=>nil,
|
|
18
|
-
"headers"=>
|
|
17
|
+
"headers"=>headers,
|
|
19
18
|
"view_content_link"=>nil,
|
|
20
19
|
"auto_text"=>nil,
|
|
21
20
|
"track_clicks"=>nil,
|
|
22
21
|
"from_name"=>"Changelog",
|
|
23
|
-
"subject"=>"[CHANGELOG]
|
|
24
|
-
"html"=>"<h1
|
|
25
|
-
"from_email"=>
|
|
22
|
+
"subject"=>"[CHANGELOG] #{app_name} #{release}",
|
|
23
|
+
"html"=>"<h1>#{app_name} Changelog</h1><h2>#{release}</h2>#{html_changelog}",
|
|
24
|
+
"from_email"=>from,
|
|
26
25
|
"preserve_recipients"=>true,
|
|
27
26
|
"auto_html"=>nil,
|
|
28
27
|
"important"=>false}
|
|
29
28
|
async = false
|
|
30
|
-
|
|
31
|
-
result = mandrill.messages.send message, async, ip_pool #, send_at
|
|
29
|
+
result = mandrill.messages.send(message, async)
|
|
32
30
|
|
|
33
31
|
|
|
34
32
|
rescue Mandrill::Error => e
|
|
@@ -39,4 +37,11 @@ def send_mail(release, html_changelog)
|
|
|
39
37
|
end
|
|
40
38
|
end
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
to = ENV['RECIPIENTS'].split(',').map{ |mail| {'email'=>mail} }
|
|
41
|
+
api_key = ENV['MANDRILL_KEY']
|
|
42
|
+
headers = {"Reply-To"=>ENV['CHANGELOG_REPLY_TO']}
|
|
43
|
+
from = ENV['CHANGELOG_FROM']
|
|
44
|
+
app_name = ENV['CHANGELOG_APP_NAME']
|
|
45
|
+
|
|
46
|
+
puts send_mail(app_name, last_release, parser.to_html[last_release],
|
|
47
|
+
to, from, api_key, headers)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mandrillamelo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alessio Caiazza
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: "."
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-11-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|