sendinblue_delivery 0.1.0 → 0.1.2
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/lib/sendinblue_delivery.rb +30 -0
- metadata +15 -31
- data/.gitignore +0 -39
- data/LICENSE +0 -21
- data/README.md +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16175d7efbd4da66b054421da33349910e9db3ee
|
4
|
+
data.tar.gz: fc65521cd1ad0471ea7251edddd19c3e840e7328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c406778da69006306efbfd7a7fd771b32b4dcde9eb513b44119863b45c31486ff3589965dff5b8cfa2bc35ad2306443ff2f82970421dc4dbe8f2d0b43a982a04
|
7
|
+
data.tar.gz: 0f02d7722c94151e2c29f84b420e4bc136c01b3bd8bce36eb9d4aa26d3345b2cf4e07b6901e008156958090c710b7f184280d31bebacc072a5e88003b8108536
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'sendinblue'
|
2
|
+
|
3
|
+
|
4
|
+
class SendinblueDelivery
|
5
|
+
|
6
|
+
def initialize(settings)
|
7
|
+
@settings = settings
|
8
|
+
end
|
9
|
+
|
10
|
+
def deliver!(message)
|
11
|
+
plain_part = message.multipart? ? (message.text_part ? message.text_part.body.decoded : nil) : message.body.decoded
|
12
|
+
html_part = message.html_part ? message.html_part.body.decoded : nil
|
13
|
+
|
14
|
+
data = {
|
15
|
+
"to" => { message.to.first => message.to.first },
|
16
|
+
"from" => message.from,
|
17
|
+
"subject" => message.subject,
|
18
|
+
"text" => plain_part,
|
19
|
+
"html" => html_part
|
20
|
+
}
|
21
|
+
|
22
|
+
# "cc" => { message.cc.first => message.cc.first },
|
23
|
+
# "bcc" => { message.bcc.first => message.bcc.first },
|
24
|
+
|
25
|
+
|
26
|
+
m = Sendinblue::Mailin.new(@settings[:url],@settings[:key],@settings[:timeout]) #Optional parameter: Timeout in Secs
|
27
|
+
m.send_email(data)
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendinblue_delivery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yann-Cyril PELUD
|
@@ -14,84 +14,70 @@ dependencies:
|
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '11.1'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '11.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '4.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '4.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.9'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.9'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: minitest
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - ~>
|
45
|
+
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '5.0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - ~>
|
52
|
+
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '5.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: byebug
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - ~>
|
59
|
+
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
61
|
version: '9.0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - ~>
|
66
|
+
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '9.0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: sendinblue
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - ~>
|
73
|
+
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
75
|
version: '2.4'
|
90
76
|
type: :runtime
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - ~>
|
80
|
+
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '2.4'
|
97
83
|
description: Add a delivery method for SendinBlue to rails
|
@@ -100,9 +86,7 @@ executables: []
|
|
100
86
|
extensions: []
|
101
87
|
extra_rdoc_files: []
|
102
88
|
files:
|
103
|
-
- .
|
104
|
-
- LICENSE
|
105
|
-
- README.md
|
89
|
+
- lib/sendinblue_delivery.rb
|
106
90
|
homepage: https://github.com/ypelud/sendinblue_delivery.git
|
107
91
|
licenses:
|
108
92
|
- MIT
|
@@ -113,17 +97,17 @@ require_paths:
|
|
113
97
|
- lib
|
114
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
99
|
requirements:
|
116
|
-
- -
|
100
|
+
- - ">="
|
117
101
|
- !ruby/object:Gem::Version
|
118
102
|
version: '0'
|
119
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
104
|
requirements:
|
121
|
-
- -
|
105
|
+
- - ">="
|
122
106
|
- !ruby/object:Gem::Version
|
123
107
|
version: 1.3.6
|
124
108
|
requirements: []
|
125
109
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.4.
|
110
|
+
rubygems_version: 2.4.6
|
127
111
|
signing_key:
|
128
112
|
specification_version: 4
|
129
113
|
summary: SendinBlue delivery
|
data/.gitignore
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
*.rbc
|
2
|
-
capybara-*.html
|
3
|
-
.rspec
|
4
|
-
/log
|
5
|
-
/tmp
|
6
|
-
/db/*.sqlite3
|
7
|
-
/db/*.sqlite3-journal
|
8
|
-
/public/system
|
9
|
-
/coverage/
|
10
|
-
/spec/tmp
|
11
|
-
**.orig
|
12
|
-
rerun.txt
|
13
|
-
pickle-email-*.html
|
14
|
-
|
15
|
-
# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
|
16
|
-
config/initializers/secret_token.rb
|
17
|
-
config/secrets.yml
|
18
|
-
|
19
|
-
## Environment normalization:
|
20
|
-
/.bundle
|
21
|
-
/vendor/bundle
|
22
|
-
|
23
|
-
# these should all be checked in to normalize the environment:
|
24
|
-
# Gemfile.lock, .ruby-version, .ruby-gemset
|
25
|
-
|
26
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
27
|
-
.rvmrc
|
28
|
-
|
29
|
-
# if using bower-rails ignore default bower_components path bower.json files
|
30
|
-
/vendor/assets/bower_components
|
31
|
-
*.bowerrc
|
32
|
-
bower.json
|
33
|
-
|
34
|
-
# Ignore pow environment settings
|
35
|
-
.powenv
|
36
|
-
|
37
|
-
.byebug_history
|
38
|
-
*.gem
|
39
|
-
Gemfile.lock
|
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2016 Yann-Cyril Pelud
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
data/README.md
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
## sendinblue_delivery
|
2
|
-
Add a delivery method for SendinBlue to rails
|
3
|
-
|
4
|
-
# Installation
|
5
|
-
Add this line to your application's Gemfile:
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
gem 'sendinblue_delivery'
|
9
|
-
```
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
```shell
|
13
|
-
$ bundle
|
14
|
-
```
|
15
|
-
|
16
|
-
Or install it yourself as:
|
17
|
-
|
18
|
-
```shell
|
19
|
-
$ gem install sendinblue_delivery
|
20
|
-
```
|
21
|
-
|
22
|
-
# Configuration
|
23
|
-
Add this to your appropriate config/environments/$RAILS_ENV.rb:
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
config.action_mailer.add_delivery_method :sendinbluemail, SendinblueDelivery
|
27
|
-
config.action_mailer.sendinbluemail_settings = {
|
28
|
-
url: 'https://api.sendinblue.com/v2.0',
|
29
|
-
key: '<your key>',
|
30
|
-
timeout: 5
|
31
|
-
}
|
32
|
-
|
33
|
-
config.action_mailer.delivery_method = :sendinbluemail
|
34
|
-
```
|