Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.29 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.29 KB

catch-all-delivery-method

Catch-all delivery method with optional recipients whitelist.

Installation

Install the gem

git clone git://github.com/rogal111/catch-all-delivery-method.git
cd catch-all-delivery-method
gem build catch-all-delivery-method.gemspec
gem install catch-all-delivery-method-0.0.0.gem

or add it to your Gemfile

gem 'catch-all-delivery-method', '>=0.0.0', :git => 'git://github.com/rogal111/catch-all-delivery-method.git'

Setup

In config/environments/development.rb (or another environment) setup delivery_method:

config.action_mailer.delivery_method = :catch_all
config.action_mailer.catch_all_settings = {
    :recipient_email => 'main_tester@example.com', # required
    :whitelist => ['tester1@example.com','tester2@example.com'], # this line is optional
    
    ##put your standard SMTP settings here
      }

or in your mailer settings:

class MyMailer < ActionMailer::Base
  self.delivery_method = :catch_all
  self.catch_all_settings = Rails.configuration.action_mailer.smtp_settings.merge({
      :recipient_email => 'main_tester@example.com', # required
	  :whitelist => ['tester1@example.com','tester2@example.com'], # this line is optional
     })
   
   ####
   # rest of mailer code
   ####
end