Skip to content

Instantly share code, notes, and snippets.

@esdras
Forked from croaky/single_recipient_smtp.rb
Created May 15, 2013 04:18
Show Gist options
  • Save esdras/5581626 to your computer and use it in GitHub Desktop.
Save esdras/5581626 to your computer and use it in GitHub Desktop.
module SingleRecipientSmtp
def self.included(clazz)
clazz.class_eval do
cattr_accessor :single_recipient_smtp_settings
end
end
def perform_delivery_single_recipient_smtp(mail)
mail.to = single_recipient_smtp_settings[:to]
mail.cc = nil
mail.bcc = nil
perform_delivery_smtp mail
end
end
config.action_mailer.delivery_method = :single_recipient_smtp
ActionMailer::Base.send :include, SingleRecipientSmtp
ActionMailer::Base.single_recipient_smtp_settings = {
:to => 'staging@example.com'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment