sendable_rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sendable_rails/action_mailer_ext.rb +13 -4
- data/lib/sendable_rails/railtie.rb +7 -2
- data/lib/sendable_rails/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8d50a75f166eadfbd955b0036f6267889f39613
|
4
|
+
data.tar.gz: 8af4aa8d5308bf41f8e4e277e51a004a214d5ebd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ea541928c19560789624d4528a30b8018106dcd756ea5ff6e4de6a4ffb197fd7a63cf38fe9f8e5d1d98d20fe3f582d77cb8be95a73f67e72db233d44dfc6dd4
|
7
|
+
data.tar.gz: 37fe0658e9f719e594380b8ed0f5452cfbc39e3d3bc37fe2bcec9cdb26642367a5d458b5902c18f3c0fbe2e06000160e2ecd5414a6153783ed8aee0b8e6f60a0
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'uri'
|
3
|
+
require 'json'
|
3
4
|
|
4
5
|
module SendableRails
|
5
6
|
module ActionMailerExt
|
@@ -32,11 +33,19 @@ module SendableRails
|
|
32
33
|
request.set_form_data(params)
|
33
34
|
response = http.request(request)
|
34
35
|
|
35
|
-
|
36
|
+
email = JSON.parse(response.body)
|
36
37
|
|
37
|
-
[
|
38
|
-
|
39
|
-
|
38
|
+
formats = []
|
39
|
+
|
40
|
+
if (email['html'])
|
41
|
+
formats << { content_type: 'text/html', body: email['html'] }
|
42
|
+
end
|
43
|
+
|
44
|
+
if (email['plain'])
|
45
|
+
formats << { content_type: 'text/plain', body: email['text'] }
|
46
|
+
end
|
47
|
+
|
48
|
+
formats
|
40
49
|
else
|
41
50
|
super
|
42
51
|
end
|
@@ -4,8 +4,13 @@ module SendableRails
|
|
4
4
|
|
5
5
|
initializer "sendable.configure" do |app|
|
6
6
|
SendableRails.config do |config|
|
7
|
-
|
8
|
-
|
7
|
+
if app.config.sendable[:project_id]
|
8
|
+
config.project_id = app.config.sendable[:project_id]
|
9
|
+
end
|
10
|
+
|
11
|
+
if app.config.sendable[:api_key]
|
12
|
+
config.api_key = app.config.sendable[:api_key]
|
13
|
+
end
|
9
14
|
end
|
10
15
|
end
|
11
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendable_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umair Siddique
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 1.3.13
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 1.3.13
|
47
47
|
description: Sendable delivery method for ActionMailer.
|
48
48
|
email:
|
49
49
|
- umairsiddique@gmail.com
|