The Paubox Ruby on Rails Gem can be used ActionMailer in Ruby on Rails. This Gem is the official Ruby on Rails wrapper for the Paubox Email API. The Paubox Email API allows your application to send secure, HIPAA compliant email via Paubox and track deliveries and opens.
SEE ALSO: Why Healthcare Businesses Choose the Paubox Email API
gem 'paubox_rails'And then execute:
$ bundleOr install it yourself as:
$ gem install paubox_rails
Paubox.configure do |config| config.api_key = ENV['PAUBOX_API_KEY'] config.api_user = ENV['PAUBOX_API_USER'] endKeep your API credentials out of version control. Set these environmental variables in a file that's not checked into version control, such as config/application.yml or config/secrets.yml.
config.action_mailer.delivery_method = :paubox
message = Mail.new do
from 'you@yourdomain.com'
to 'someone@somewhere.com'
subject 'HIPAA compliant email made easy'
text_part do
body 'This message will be sent securely by Paubox.'
end
html_part do
content_type 'text/html; charset=UTF-8'
body '
message = Mail.new do from 'you@yourdomain.com' to 'someone@somewhere.com' subject 'Sending non-PHI' body 'This message delivery will not enforce TLS transmission.' delivery_method Mail::Paubox end message.allow_non_tls = true message.deliver!
args = { from: 'you@yourdomain.com',
to: 'someone@domain.com, someone-else@domain.com',
cc: ['another@domain.com', 'yet-another@domain.com'],
bcc: 'bcc-recipient@domain.com',
reply_to: 'reply-to@yourdomain.com',
subject: 'Testing!',
text_content: 'Hello World!',
html_content: '
client = Paubox::Client.new
email_disposition = client.email_disposition('2a3c048485aa4cf6')
# Get array of email_dispositions. One email_disposition is generated for each recipient.
message_deliveries = email_disposition.message_deliveries
=> [>]
# Inspect a message delivery
delivery = message_deliveries.first
delivery.recipient
=> "test@domain.com"
# Inspect the message delivery status
status = delivery.status
status.delivery_status
=> "delivered"
status.delivery_time
=> Mon, 30 Apr 2018 12:54:19 -0700
# opened_status is only available for single-recipient messages
status.opened_status
=> "opened"
# opened_time is only available for single-recipient messages
status.opened_time
=> Mon, 30 Apr 2018 12:55:19 -0700