Skip to content

A gem to use Postal as a delivery method with the Ruby Mail gem

Notifications You must be signed in to change notification settings

postalserver/postal-mailgem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Postal for the Mail Gem

This allows you to easily deliver messages through Postal using the Ruby mail gem.

Installation

Add the gems to your Gemfile and run bundle install.

gem 'mail'
gem 'postal-mailgem'

Configuraton

You can set the delivery method globally to use Postal.

Mail.defaults do
  delivery_method :postal, :host => 'https://postal.yourdomain.com', :server_key => 'xxx'
end

Or, you can configure it on a per message basis:

message = Mail.new
message.to "[email protected]"
message.from "[email protected]"
message.body "Hello there!"
message.delivery_method :postal, :host => 'https://postal.yourdomain.com', :server_key => 'xxx'
message.deliver

You don't need to specify a server_key or host if you have set the POSTAL_KEY and POSTAL_HOST environment variables.

About

A gem to use Postal as a delivery method with the Ruby Mail gem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages