我正在使用 Redmine 并将我的 configuration.yml 配置为使用 Mandrill 的 SMTP。电子邮件毫无疑问,但我想从 Mandrill 分配一个模板:

# default configuration options for all environments
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: "smtp.mandrillapp.com"
      port: 587
      domain: "example.org"
      authentication: :login
      user_name: "username"
      password: "password"
      headers["X-MC-Template"]: "templatename|main"

它不会将标头模板发送到 Mandrill,虽然我认为它应该以这种方式工作。据我从 Redmine 的源代码检查,它使用 ActionMailer(http://www.redmine.org/projects/redmine/repository/revisions/8785/entry/trunk/app/models/mailer.rb)

文件:https://mandrill.zendesk.com/hc/en-us/articles/205582117-How-to-Use-SMTP-Headers-to-Customize-Your-Messages#custom-header-reference

ActionMailer:https://apidock.com/rails/ActionMailer/Base/headers

谁熟悉 Actionmailer?