【问题标题】:MandrillMailer Ruby Gem with Interceptors带有拦截器的 MandrillMailer Ruby Gem
【发布时间】:2012-12-12 15:51:48
【问题描述】:

我正在使用 Mandrill Mailer Ruby Gem (https://github.com/renz45/mandrill_mailer),但我想设置一个拦截器,以便在开发(和暂存)中将电子邮件发送到不同的电子邮件地址。

我不确定如何使用 gem 本身来执行此操作。如果使用开箱即用的 ActionMailer,我知道如何执行此操作,但对如何在此之外完成此操作有点困惑。

有任何想法或其他人遇到这个问题吗?

【问题讨论】:

    标签: ruby-on-rails-3 mailchimp mailer transactional-email


    【解决方案1】:

    当使用带有 mandrill_mail 方法的模板时,这对我有用。

    config/environments/test.rb

    MandrillMailer.configure do |config|
      config.interceptor_params = { to: [email: 'homer@simpson.com', name: 'Homer Simpson'] }
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多