Skip to content

Instantly share code, notes, and snippets.

@chhhris
Last active January 4, 2016 20:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chhhris/39d6dbae3f1f284ee1c6 to your computer and use it in GitHub Desktop.
Save chhhris/39d6dbae3f1f284ee1c6 to your computer and use it in GitHub Desktop.
Sending live emails in development mode
# now with Mandrill
# with SENDGRID
# sending emails to your email while in development mode.
# mail_interceptor.rb
if Rails.env.development?
message.to = 'your@email.com'
end
# sendgrid.rb
if Rails.env.development?
ActionMailer::Base.delivery_method = :sendmail
end
ActionMailer::Base.register_interceptor(MailInterceptor) if Rails.env.development? || Rails.env.staging?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment