I have ActionMailer configured to send emails through gmail in development mode.
config/development.rb
config.action_mailer.default_url_options = { host: ENV["MY_DOMAIN"] }
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: ENV["MY_DOMAIN"],
authentication: "plain",
enable_starttls_auto: true,
user_name: ENV["MY_USERNAME"],
password: ENV["MY_PASSWORD"]
}
I have this set up so my designer can trigger and send test html emails to a designated address for testing in a variety of browsers / devices.
However, in development mode, I'd like to block all outgoing emails that are not being sent to that one designated email address.
I'm looking for something like:
config.action_mailer.perform_deliveries = target_is_designated_email_address?
... but I need someway to inspect the Mail instance, to ensure that it's being sent to the correct address.
any ideas?
thanks!