paubox 0.1.3 → 0.2.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/README.md +102 -84
- data/lib/paubox/version.rb +1 -1
- data/paubox_ruby.gemspec +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: 6385417dd81032791ac6552496137561e27aa435
|
4
|
+
data.tar.gz: dd150320e7ba927dfa0e83354917caad0a2f651f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 221086699f1e8a9376bcb82ea4ba001a21c739612343ebb7c9492dc23fe13b570f0a358ceba705643a3149791d6d60c1e5292b3513a8c3743a75920eb2088f72
|
7
|
+
data.tar.gz: c80e028f4962360571e8044c0b9a76e544e4e762c590723603819b47067b2b9aa67a8c67e0ccd59c3f0478cf08f72dc8173bb60496c0a715267650cc7d90caeb
|
data/README.md
CHANGED
@@ -1,10 +1,20 @@
|
|
1
|
+
<img src="https://github.com/Paubox/paubox-csharp/raw/master/paubox_logo.png" alt="Paubox" width="150px">
|
2
|
+
|
1
3
|
# Paubox Gem
|
2
|
-
This gem and Paubox Transactional Email HTTP API are currently in
|
4
|
+
This gem and Paubox Transactional Email HTTP API are currently in alpha development.
|
3
5
|
|
4
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.
|
5
7
|
|
6
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.
|
7
9
|
|
10
|
+
# Table of Contents
|
11
|
+
* [Installation](#installation)
|
12
|
+
* [Usage](#usage)
|
13
|
+
* [Contributing](#contributing)
|
14
|
+
* [License](#license)
|
15
|
+
|
16
|
+
|
17
|
+
<a name="#installation"></a>
|
8
18
|
## Installation
|
9
19
|
|
10
20
|
Add this line to your application's Gemfile:
|
@@ -22,120 +32,128 @@ Or install it yourself as:
|
|
22
32
|
$ gem install paubox
|
23
33
|
|
24
34
|
### Getting Paubox API Credentials
|
25
|
-
You will need to have a Paubox account.
|
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.
|
26
38
|
|
27
39
|
### Configuring API Credentials
|
28
40
|
Include your API credentials in an initializer (e.g. config/initializers/paubox.rb in Rails).
|
29
41
|
|
30
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
|
+
```
|
31
49
|
|
32
|
-
|
33
|
-
config.api_key = ENV['PAUBOX_API_KEY']
|
34
|
-
config.api_user = ENV['PAUBOX_API_USER']
|
35
|
-
end
|
36
|
-
|
50
|
+
<a name="#usage"></a>
|
37
51
|
## Usage
|
38
52
|
|
39
53
|
### Sending Messages with the Ruby Mail Library
|
40
54
|
|
41
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
|
42
70
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
html_part do
|
53
|
-
content_type 'text/html; charset=UTF-8'
|
54
|
-
body '<h1>This message will be sent securely by Paubox.</h1>'
|
55
|
-
end
|
56
|
-
|
57
|
-
delivery_method Mail::Paubox
|
58
|
-
end
|
59
|
-
|
60
|
-
message.deliver!
|
61
|
-
=> {"message"=>"Service OK", "sourceTrackingId"=>"2a3c048485aa4cf6"}
|
62
|
-
|
63
|
-
message.source_tracking_id
|
64
|
-
=> "2a3c048485aa4cf6"
|
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
|
+
```
|
65
80
|
|
66
81
|
### Allowing non-TLS message delivery
|
67
82
|
|
68
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.'
|
69
90
|
|
70
|
-
|
71
|
-
|
72
|
-
to 'someone@somewhere.com'
|
73
|
-
subject 'Sending non-PHI'
|
74
|
-
body 'This message delivery will not enforce TLS transmission.'
|
91
|
+
delivery_method Mail::Paubox
|
92
|
+
end
|
75
93
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
message.allow_non_tls = true
|
80
|
-
message.deliver!
|
94
|
+
message.allow_non_tls = true
|
95
|
+
message.deliver!
|
96
|
+
```
|
81
97
|
|
82
98
|
### Sending Messages using just the Paubox API
|
83
99
|
You don't need to use Ruby Mail to build and send messages with Paubox.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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
|
+
```
|
99
116
|
|
100
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>>]
|
101
125
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
# Get array of email_dispositions. One email_disposition is generated for each recipient.
|
106
|
-
message_deliveries = email_disposition.message_deliveries
|
107
|
-
=> [<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>>]
|
108
|
-
|
109
|
-
# Inspect a message delivery
|
110
|
-
delivery = message_deliveries.first
|
111
|
-
|
112
|
-
delivery.recipient
|
113
|
-
=> "test@domain.com"
|
114
|
-
|
115
|
-
# Inspect the message delivery status
|
116
|
-
status = delivery.status
|
117
|
-
|
118
|
-
status.delivery_status
|
119
|
-
=> "delivered"
|
120
|
-
|
121
|
-
status.delivery_time
|
122
|
-
=> Mon, 30 Apr 2018 12:54:19 -0700
|
123
|
-
|
124
|
-
# opened_status is only available for single-recipient messages
|
125
|
-
status.opened_status
|
126
|
-
=> "opened"
|
127
|
-
|
128
|
-
# opened_time is only available for single-recipient messages
|
129
|
-
status.opened_time
|
130
|
-
=> Mon, 30 Apr 2018 12:55:19 -0700
|
131
|
-
|
126
|
+
# Inspect a message delivery
|
127
|
+
delivery = message_deliveries.first
|
132
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
|
+
```
|
133
149
|
|
150
|
+
<a name="#contributing"></a>
|
134
151
|
## Contributing
|
135
152
|
|
136
153
|
Bug reports and pull requests are welcome on GitHub at https://github.com/paubox/paubox_ruby.
|
137
154
|
|
138
155
|
|
156
|
+
<a name="#license"></a>
|
139
157
|
## License
|
140
158
|
|
141
159
|
Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/paubox/version.rb
CHANGED
data/paubox_ruby.gemspec
CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'webmock', '~> 2.1'
|
28
28
|
spec.add_development_dependency 'pry'
|
29
29
|
|
30
|
-
spec.add_dependency 'mail', '>= 2.
|
30
|
+
spec.add_dependency 'mail', '>= 2.5'
|
31
31
|
spec.add_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
|
32
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paubox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paubox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-04
|
12
|
+
date: 2018-10-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '2.
|
90
|
+
version: '2.5'
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '2.
|
97
|
+
version: '2.5'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rest-client
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|