paubox 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6385417dd81032791ac6552496137561e27aa435
4
- data.tar.gz: dd150320e7ba927dfa0e83354917caad0a2f651f
2
+ SHA256:
3
+ metadata.gz: a259c46c870059aff289a90bc661f86de6954c33b88ae75613dee3c9f15c1418
4
+ data.tar.gz: 4a5768c1ee7b711c91576ef7f43fc219150ed0c5f81512fe36269c09db825c8e
5
5
  SHA512:
6
- metadata.gz: 221086699f1e8a9376bcb82ea4ba001a21c739612343ebb7c9492dc23fe13b570f0a358ceba705643a3149791d6d60c1e5292b3513a8c3743a75920eb2088f72
7
- data.tar.gz: c80e028f4962360571e8044c0b9a76e544e4e762c590723603819b47067b2b9aa67a8c67e0ccd59c3f0478cf08f72dc8173bb60496c0a715267650cc7d90caeb
6
+ metadata.gz: 4285803ec83dd1f57b4407a4c0e7e177e1d571dcf6075b04707377c0286f1d76693858e69d6c6784d21245c286474025eb3514ddcb9414f2001891e6bcede3a5
7
+ data.tar.gz: 6e5b536a02e5df73675b255f6ed8080d3a5bf97a48f533bc2fb5f0e3189c8013cf7a373afffc957fe854335b07e074e1f2c858dbe50e2e64ab41ff7231c73aea
data/.gitignore CHANGED
@@ -1,13 +1,14 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.vscode/
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
13
14
  .gem
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --format documentation
2
- --color
1
+ --format documentation
2
+ --color
@@ -1,5 +1,5 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.14.6
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.14.6
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in paubox_ruby.gemspec
4
- gemspec
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in paubox_ruby.gemspec
6
+ gemspec
@@ -1,13 +1,13 @@
1
- Copyright 2018 Paubox Inc.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
1
+ Copyright 2018 Paubox Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
13
  limitations under the License.
data/README.md CHANGED
@@ -1,171 +1,230 @@
1
- <img src="https://github.com/Paubox/paubox-csharp/raw/master/paubox_logo.png" alt="Paubox" width="150px">
2
-
3
- # Paubox Gem
4
- This gem and Paubox Transactional Email HTTP API are currently in alpha development.
5
-
6
- This is the official Ruby wrapper for the Paubox Transactional Email HTTP API. The Paubox Transactional Email API allows your application to send secure, HIPAA-compliant email via Paubox and track deliveries and opens.
7
-
8
- It extends the [Ruby Mail Library](https://github.com/mikel/mail) for seamless integration in your existing Ruby application. The API wrapper also allows you to construct and send messages directly without the Ruby Mail Library.
9
-
10
- # Table of Contents
11
- * [Installation](#installation)
12
- * [Usage](#usage)
13
- * [Contributing](#contributing)
14
- * [License](#license)
15
-
16
-
17
- <a name="#installation"></a>
18
- ## Installation
19
-
20
- Add this line to your application's Gemfile:
21
-
22
- ```ruby
23
- gem 'paubox'
24
- ```
25
-
26
- And then execute:
27
-
28
- $ bundle install
29
-
30
- Or install it yourself as:
31
-
32
- $ gem install paubox
33
-
34
- ### Getting Paubox API Credentials
35
- You will need to have a Paubox account. You can [sign up here](https://www.paubox.com/join/see-pricing?unit=messages).
36
-
37
- Once you have an account, follow the instructions on the Rest API dashboard to verify domain ownership and generate API credentials.
38
-
39
- ### Configuring API Credentials
40
- Include your API credentials in an initializer (e.g. config/initializers/paubox.rb in Rails).
41
-
42
- Keep your API credentials out of version control. Store these in environmental variables.
43
- ```ruby
44
- Paubox.configure do |config|
45
- config.api_key = ENV['PAUBOX_API_KEY']
46
- config.api_user = ENV['PAUBOX_API_USER']
47
- end
48
- ```
49
-
50
- <a name="#usage"></a>
51
- ## Usage
52
-
53
- ### Sending Messages with the Ruby Mail Library
54
-
55
- Using the Ruby Mail Library? Sending via Paubox is easy. Just build a message as normal and set Mail::Paubox as the delivery method.
56
- ```ruby
57
- message = Mail.new do
58
- from 'you@yourdomain.com'
59
- to 'someone@somewhere.com'
60
- subject 'HIPAA-compliant email made easy'
61
-
62
- text_part do
63
- body 'This message will be sent securely by Paubox.'
64
- end
65
-
66
- html_part do
67
- content_type 'text/html; charset=UTF-8'
68
- body '<h1>This message will be sent securely by Paubox.</h1>'
69
- end
70
-
71
- delivery_method Mail::Paubox
72
- end
73
-
74
- message.deliver!
75
- => {"message"=>"Service OK", "sourceTrackingId"=>"2a3c048485aa4cf6"}
76
-
77
- message.source_tracking_id
78
- => "2a3c048485aa4cf6"
79
- ```
80
-
81
- ### Allowing non-TLS message delivery
82
-
83
- If you want to send non-PHI mail that does not need to be HIPAA-compliant, you can allow the message delivery to take place even if a TLS connection is unavailable. This means a message will not be converted into a secure portal message when a non-TLS connection is encountered.
84
- ```ruby
85
- message = Mail.new do
86
- from 'you@yourdomain.com'
87
- to 'someone@somewhere.com'
88
- subject 'Sending non-PHI'
89
- body 'This message delivery will not enforce TLS transmission.'
90
-
91
- delivery_method Mail::Paubox
92
- end
93
-
94
- message.allow_non_tls = true
95
- message.deliver!
96
- ```
97
-
98
- ### Sending Messages using just the Paubox API
99
- You don't need to use Ruby Mail to build and send messages with Paubox.
100
- ```ruby
101
- args = { from: 'you@yourdomain.com',
102
- to: 'someone@domain.com, someone-else@domain.com',
103
- cc: ['another@domain.com', 'yet-another@domain.com'],
104
- bcc: 'bcc-recipient@domain.com',
105
- reply_to: 'reply-to@yourdomain.com',
106
- subject: 'Testing!',
107
- text_content: 'Hello World!',
108
- html_content: '<h1>Hello World!</h1>' }
109
-
110
- message = Paubox::Message.new(args)
111
-
112
- client = Paubox::Client.new
113
- client.deliver_mail(message)
114
- => {"message"=>"Service OK", "sourceTrackingId"=>"2a3c048485aa4cf6"}
115
- ```
116
-
117
- ### Checking Email Dispositions
118
- ```ruby
119
- client = Paubox::Client.new
120
- email_disposition = client.email_disposition('2a3c048485aa4cf6')
121
-
122
- # Get array of email_dispositions. One email_disposition is generated for each recipient.
123
- message_deliveries = email_disposition.message_deliveries
124
- => [<struct Paubox::EmailDisposition::MessageDelivery recipient="test@domain.com", status=#<struct Paubox::EmailDisposition::MessageDeliveryStatus delivery_status="delivered", delivery_time=Mon, 30 Apr 2018 12:54:19 -0700, opened_status="opened", opened_time=Mon, 30 Apr 2018 12:55:19 -0700>>]
125
-
126
- # Inspect a message delivery
127
- delivery = message_deliveries.first
128
-
129
- delivery.recipient
130
- => "test@domain.com"
131
-
132
- # Inspect the message delivery status
133
- status = delivery.status
134
-
135
- status.delivery_status
136
- => "delivered"
137
-
138
- status.delivery_time
139
- => Mon, 30 Apr 2018 12:54:19 -0700
140
-
141
- # opened_status is only available for single-recipient messages
142
- status.opened_status
143
- => "opened"
144
-
145
- # opened_time is only available for single-recipient messages
146
- status.opened_time
147
- => Mon, 30 Apr 2018 12:55:19 -0700
148
- ```
149
-
150
- <a name="#contributing"></a>
151
- ## Contributing
152
-
153
- Bug reports and pull requests are welcome on GitHub at https://github.com/paubox/paubox_ruby.
154
-
155
-
156
- <a name="#license"></a>
157
- ## License
158
-
159
- Licensed under the Apache License, Version 2.0 (the "License");
160
- you may not use this file except in compliance with the License.
161
- You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
162
-
163
- Unless required by applicable law or agreed to in writing, software
164
- distributed under the License is distributed on an "AS IS" BASIS,
165
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
166
- See the License for the specific language governing permissions and
167
- limitations under the License.
168
-
169
- ## Copyright
170
- Copyright &copy; 2018, Paubox Inc.
171
-
1
+ <img src="https://github.com/Paubox/paubox-csharp/raw/master/paubox_logo.png" alt="Paubox" width="150px">
2
+
3
+ # Paubox Gem
4
+ This gem and Paubox Transactional Email HTTP API are currently in alpha development.
5
+
6
+ This is the official Ruby wrapper for the Paubox Transactional Email HTTP API. The Paubox Transactional Email API allows your application to send secure, HIPAA-compliant email via Paubox and track deliveries and opens.
7
+
8
+ It extends the [Ruby Mail Library](https://github.com/mikel/mail) for seamless integration in your existing Ruby application. The API wrapper also allows you to construct and send messages directly without the Ruby Mail Library.
9
+
10
+ # Table of Contents
11
+ * [Installation](#installation)
12
+ * [Usage](#usage)
13
+ * [Contributing](#contributing)
14
+ * [License](#license)
15
+
16
+
17
+ <a name="#installation"></a>
18
+ ## Installation
19
+
20
+ Add this line to your application's Gemfile:
21
+
22
+ ```ruby
23
+ gem 'paubox'
24
+ ```
25
+
26
+ And then execute:
27
+
28
+ $ bundle install
29
+
30
+ Or install it yourself as:
31
+
32
+ $ gem install paubox
33
+
34
+ ### Getting Paubox API Credentials
35
+ You will need to have a Paubox account. You can [sign up here](https://www.paubox.com/join/see-pricing?unit=messages).
36
+
37
+ Once you have an account, follow the instructions on the Rest API dashboard to verify domain ownership and generate API credentials.
38
+
39
+ ### Configuring API Credentials
40
+ Include your API credentials in an initializer (e.g. config/initializers/paubox.rb in Rails).
41
+
42
+ Keep your API credentials out of version control. Store these in environmental variables.
43
+ ```ruby
44
+ Paubox.configure do |config|
45
+ config.api_key = ENV['PAUBOX_API_KEY']
46
+ config.api_user = ENV['PAUBOX_API_USER']
47
+ end
48
+ ```
49
+
50
+ <a name="#usage"></a>
51
+ ## Usage
52
+
53
+ ### Sending Messages with the Ruby Mail Library
54
+
55
+ Using the Ruby Mail Library? Sending via Paubox is easy. Just build a message as normal and set Mail::Paubox as the delivery method.
56
+ ```ruby
57
+ require 'Paubox'
58
+ require 'json'
59
+ require 'mail'
60
+
61
+ message = Mail.new do
62
+ from 'you@yourdomain.com'
63
+ to 'someone@somewhere.com'
64
+ cc 'another@somewhere.com'
65
+ subject 'HIPAA-compliant email made easy'
66
+
67
+ text_part do
68
+ body 'This message will be sent securely by Paubox.'
69
+ end
70
+
71
+ html_part do
72
+ content_type 'text/html; charset=UTF-8'
73
+ body '<h1>This message will be sent securely by Paubox.</h1>'
74
+ end
75
+
76
+ delivery_method Mail::Paubox
77
+ end
78
+
79
+ message.deliver!
80
+ => {"message"=>"Service OK", "sourceTrackingId"=>"2a3c048485aa4cf6"}
81
+
82
+ message.source_tracking_id
83
+ => "2a3c048485aa4cf6"
84
+ ```
85
+
86
+ ### Allowing non-TLS message delivery
87
+
88
+ If you want to send non-PHI mail that does not need to be HIPAA-compliant, you can allow the message delivery to take place even if a TLS connection is unavailable. This means a message will not be converted into a secure portal message when a non-TLS connection is encountered.
89
+ ```ruby
90
+ require 'Paubox'
91
+ require 'json'
92
+ require 'mail'
93
+
94
+ message = Mail.new do
95
+ from 'you@yourdomain.com'
96
+ to 'someone@somewhere.com'
97
+ subject 'Sending non-PHI'
98
+ body 'This message delivery will not enforce TLS transmission.'
99
+
100
+ delivery_method Mail::Paubox
101
+ end
102
+
103
+ message.allow_non_tls = true
104
+ message.deliver!
105
+ ```
106
+
107
+ ### Forcing Secure Notifications
108
+
109
+ Paubox Secure Notifications allow an extra layer of security, especially when coupled with an organization's requirement for message recipients to use 2-factor authentication to read messages (this setting is available to org administrators in the Paubox Admin Panel).
110
+
111
+ Instead of receiving an email with the message contents, the recipient will receive a notification email that they have a new message in Paubox.
112
+ ```ruby
113
+ require 'Paubox'
114
+ require 'json'
115
+ require 'mail'
116
+
117
+ message = Mail.new do
118
+ from 'you@yourdomain.com'
119
+ to 'someone@somewhere.com'
120
+ subject 'Sending non-PHI'
121
+ body 'This message delivery will not enforce TLS transmission.'
122
+
123
+ delivery_method Mail::Paubox
124
+ end
125
+
126
+ message.force_secure_notification = 'true'
127
+ message.deliver!
128
+ ```
129
+
130
+ ### Adding Attachments
131
+
132
+ ```ruby
133
+ require 'Paubox'
134
+ require 'json'
135
+ require 'mail'
136
+
137
+ message = Mail.new do
138
+ from 'you@yourdomain.com'
139
+ to 'someone@somewhere.com'
140
+ cc 'another@somewhere.com'
141
+ subject 'HIPAA-compliant email made easy'
142
+
143
+ delivery_method Mail::Paubox
144
+ end
145
+
146
+ message.add_file("D:\\TestFolder\\YourFileName.txt")
147
+ message.deliver!
148
+ ```
149
+
150
+ ### Sending Messages using just the Paubox API
151
+ You don't need to use Ruby Mail to build and send messages with Paubox.
152
+ ```ruby
153
+ require 'Paubox'
154
+ require 'json'
155
+
156
+ args = { from: 'you@yourdomain.com',
157
+ to: 'someone@domain.com, someone-else@domain.com',
158
+ cc: ['another@domain.com', 'yet-another@domain.com'],
159
+ bcc: 'bcc-recipient@domain.com',
160
+ reply_to: 'reply-to@yourdomain.com',
161
+ subject: 'Testing!',
162
+ text_content: 'Hello World!',
163
+ html_content: '<h1>Hello World!</h1>'
164
+ }
165
+
166
+ message = Paubox::Message.new(args)
167
+
168
+ client = Paubox::Client.new
169
+ client.deliver_mail(message)
170
+ => {"message"=>"Service OK", "sourceTrackingId"=>"2a3c048485aa4cf6"}
171
+ ```
172
+
173
+ ### Checking Email Dispositions
174
+ ```ruby
175
+ require 'Paubox'
176
+ require 'json'
177
+
178
+ client = Paubox::Client.new
179
+ email_disposition = client.email_disposition('2a3c048485aa4cf6')
180
+
181
+ # Get array of email_dispositions. One email_disposition is generated for each recipient.
182
+ message_deliveries = email_disposition.message_deliveries
183
+ => [<struct Paubox::EmailDisposition::MessageDelivery recipient="test@domain.com", status=#<struct Paubox::EmailDisposition::MessageDeliveryStatus delivery_status="delivered", delivery_time=Mon, 30 Apr 2018 12:54:19 -0700, opened_status="opened", opened_time=Mon, 30 Apr 2018 12:55:19 -0700>>]
184
+
185
+ # Inspect a message delivery
186
+ delivery = message_deliveries.first
187
+
188
+ delivery.recipient
189
+ => "test@domain.com"
190
+
191
+ # Inspect the message delivery status
192
+ status = delivery.status
193
+
194
+ status.delivery_status
195
+ => "delivered"
196
+
197
+ status.delivery_time
198
+ => Mon, 30 Apr 2018 12:54:19 -0700
199
+
200
+ # opened_status is only available for single-recipient messages
201
+ status.opened_status
202
+ => "opened"
203
+
204
+ # opened_time is only available for single-recipient messages
205
+ status.opened_time
206
+ => Mon, 30 Apr 2018 12:55:19 -0700
207
+ ```
208
+
209
+ <a name="#contributing"></a>
210
+ ## Contributing
211
+
212
+ Bug reports and pull requests are welcome on GitHub at https://github.com/paubox/paubox_ruby.
213
+
214
+
215
+ <a name="#license"></a>
216
+ ## License
217
+
218
+ Licensed under the Apache License, Version 2.0 (the "License");
219
+ you may not use this file except in compliance with the License.
220
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
221
+
222
+ Unless required by applicable law or agreed to in writing, software
223
+ distributed under the License is distributed on an "AS IS" BASIS,
224
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
225
+ See the License for the specific language governing permissions and
226
+ limitations under the License.
227
+
228
+ ## Copyright
229
+ Copyright &copy; 2019, Paubox Inc.
230
+