paubox 0.1.0 → 0.1.1
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 +94 -2
- data/lib/mail/paubox.rb +1 -1
- data/lib/paubox/mail_to_message.rb +4 -2
- data/lib/paubox/version.rb +1 -1
- data/paubox-0.1.0.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71a4b58946b0869eac1768ba49c208950fc7d6f2
|
4
|
+
data.tar.gz: 704a4cf54c5ef966e0f060ad3186f7aab314ecca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89fa8a685e2170ee6ebbf87c2845c7eb3eb875576fc9fd002034d6c33c94fd159c04a0cd5f13985311de9b614ceb8d5f1bd589767b60fad5ebf2adb999497c58
|
7
|
+
data.tar.gz: 44ab568c8b28b5f77c376851865e0892bf17cbb59f1975e8af47a69be6202cd8ea9ac152aa6c79ff37dcf39497ccd4bc8565254e619876c7ed0d5e314d738b51
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Paubox Gem
|
2
|
-
This
|
2
|
+
This gem and Paubox Transactional Email HTTP API are currently in pre-alpha development.
|
3
|
+
|
4
|
+
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
|
+
|
6
|
+
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.
|
3
7
|
|
4
8
|
## Installation
|
5
9
|
|
@@ -17,6 +21,83 @@ Or install it yourself as:
|
|
17
21
|
|
18
22
|
$ gem install paubox
|
19
23
|
|
24
|
+
### Getting Paubox API Credentials
|
25
|
+
You will need to have a Paubox account. Please contact [Paubox Customer Success](https://paubox.zendesk.com/hc/en-us) for details on gaining access to the Transactional Email API alpha testing program.
|
26
|
+
|
27
|
+
### Configuring API Credentials
|
28
|
+
To set your API credentials you'll need to include these in an initializer (config/initializers/paubox.rb in Rails).
|
29
|
+
|
30
|
+
Be careful not to commit your API credentials to version control. It's best to store these in environmental variables.
|
31
|
+
|
32
|
+
Paubox.configure do |config|
|
33
|
+
config.api_key = ENV['PAUBOX_API_KEY']
|
34
|
+
config.api_user = ENV['PAUBOX_API_USER']
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
### Sending Messages with the Ruby Mail Library
|
39
|
+
|
40
|
+
If you're already using the Ruby Mail Library, sending via Paubox is easy. Just build your message as normal and set Mail::Paubox as the delivery method.
|
41
|
+
|
42
|
+
message = Mail.new do
|
43
|
+
from 'you@yourdomain.com'
|
44
|
+
to 'someone@somewhere.com'
|
45
|
+
subject 'HIPAA-compliant email made easy'
|
46
|
+
|
47
|
+
text_part do
|
48
|
+
body 'This message will be sent securely by Paubox.'
|
49
|
+
end
|
50
|
+
|
51
|
+
html_part do
|
52
|
+
content_type 'text/html; charset=UTF-8'
|
53
|
+
body '<h1>This message will be sent securely by Paubox.</h1>'
|
54
|
+
end
|
55
|
+
|
56
|
+
delivery_method Mail::Paubox
|
57
|
+
end
|
58
|
+
|
59
|
+
message.deliver!
|
60
|
+
=> {"message"=>"Service OK", "sourceTrackingId"=>"2a3c048485aa4cf6"}
|
61
|
+
|
62
|
+
message.source_tracking_id
|
63
|
+
=> "2a3c048485aa4cf6"
|
64
|
+
|
65
|
+
### Sending Messages without ensuring TLS
|
66
|
+
|
67
|
+
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.
|
68
|
+
|
69
|
+
message = Mail.new do
|
70
|
+
from 'you@yourdomain.com'
|
71
|
+
to 'someone@somewhere.com'
|
72
|
+
subject 'Sending non-PHI'
|
73
|
+
body 'This message delivery will not enforce TLS transmission.'
|
74
|
+
|
75
|
+
delivery_method Mail::Paubox
|
76
|
+
end
|
77
|
+
|
78
|
+
message.allow_non_tls = true
|
79
|
+
message.deliver!
|
80
|
+
|
81
|
+
### Sending Messages using just the Paubox API
|
82
|
+
|
83
|
+
args = { from: 'you@yourdomain.com',
|
84
|
+
to: 'someone@domain.com, someone_else@domain.com',
|
85
|
+
cc: ['another@domain.com', 'yetanother@domain.com'],
|
86
|
+
bcc: 'bcc-recipient@domain.com',
|
87
|
+
reply_to: 'reply-to@yourdomain.com',
|
88
|
+
subject: 'Testing!',
|
89
|
+
text_content: 'Hello World!',
|
90
|
+
html_content: '<h1>Hello World!</h1>' }
|
91
|
+
|
92
|
+
message = Message.new(args)
|
93
|
+
|
94
|
+
client = Paubox::Client.new
|
95
|
+
client.deliver_mail(message)
|
96
|
+
=> {"message"=>"Service OK", "sourceTrackingId"=>"2a3c048485aa4cf6"}
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
20
101
|
## Contributing
|
21
102
|
|
22
103
|
Bug reports and pull requests are welcome on GitHub at https://github.com/paubox/paubox_ruby.
|
@@ -24,5 +105,16 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/paubox
|
|
24
105
|
|
25
106
|
## License
|
26
107
|
|
27
|
-
|
108
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
109
|
+
you may not use this file except in compliance with the License.
|
110
|
+
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
111
|
+
|
112
|
+
Unless required by applicable law or agreed to in writing, software
|
113
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
114
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
115
|
+
See the License for the specific language governing permissions and
|
116
|
+
limitations under the License.
|
117
|
+
|
118
|
+
## Copyright
|
119
|
+
Copyright © 2018, Paubox Inc.
|
28
120
|
|
data/lib/mail/paubox.rb
CHANGED
@@ -34,8 +34,10 @@ module Paubox
|
|
34
34
|
if mail.multipart?
|
35
35
|
html_content = mail.html_part.body.to_s if mail.html_part
|
36
36
|
text_content = mail.text_part.body.to_s if mail.text_part
|
37
|
-
content[:html_content] = html_content unless html_content.
|
38
|
-
content[:text_content] = text_content unless text_content.
|
37
|
+
content[:html_content] = html_content unless html_content.nil?
|
38
|
+
content[:text_content] = text_content unless text_content.nil?
|
39
|
+
elsif mail.content_type.to_s.include? 'text/html'
|
40
|
+
content[:html_content] = mail.body.to_s
|
39
41
|
else
|
40
42
|
content[:text_content] = mail.body.to_s
|
41
43
|
end
|
data/lib/paubox/version.rb
CHANGED
data/paubox-0.1.0.gem
ADDED
Binary file
|
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.1.
|
4
|
+
version: 0.1.1
|
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-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/paubox/message.rb
|
146
146
|
- lib/paubox/version.rb
|
147
147
|
- lib/paubox_ruby.rb
|
148
|
+
- paubox-0.1.0.gem
|
148
149
|
- paubox_ruby.gemspec
|
149
150
|
homepage: https://www.paubox.com
|
150
151
|
licenses:
|