https://github.com/postalserver/postal-rails
A Rails library for the Postal e-mail platform
https://github.com/postalserver/postal-rails
Last synced: 8 months ago
JSON representation
A Rails library for the Postal e-mail platform
- Host: GitHub
- URL: https://github.com/postalserver/postal-rails
- Owner: postalserver
- Created: 2017-04-20T15:15:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-28T04:45:02.000Z (over 7 years ago)
- Last Synced: 2025-04-08T19:46:48.327Z (9 months ago)
- Language: Ruby
- Size: 3.91 KB
- Stars: 23
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Postal for Rails
Postal for Rails allows you to integrate Postal directly into Action Mailer in a Rails application. There's no need to change any of your existing mailers, you just need to update your environment config.
## Installation
Add the `postal-rails` gem to your Gemfile and run `bundle install` to install it.
```ruby
gem 'postal-rails', '~> 1.0'
```
## Configuration
Open up your `config/environment/production.rb` or `config/environment/development.rb` and change the delivery method to `postal`.
```ruby
config.action_mailer.delivery_method = :postal
```
You'll also need to provide your server key. If you don't have a server key, login to your web interface and generate a credential for the server you wish to send messages through.
You also need to set the `POSTAL_KEY` environment variable to include key and `POSTAL_HOST` to include the hostname of your Postal service.
Alternatively, you can configure it as shown below in your environment configuration file along with the `delivery_method`.
```ruby
config.action_mailer.postal_settings = {:host => "postal.yourdomainc.com", :server_key => "xxxxx"}
```
That's it! Send an email to test everything is working as you'd expect. Remember, if you have `raise_delivery_errors` set to false you might not see any errors. Use `deliver!` when running your tests so any exceptions are raised.
Don't forget, you need to make sure that you're sending mail from domains that are added & verified to your Postal domain.