【问题标题】:Postmark works on local but not staging, mysterious sender signature issue邮戳适用于本地但不暂存的神秘发件人签名问题
【发布时间】:2013-06-19 22:06:51
【问题描述】:

这是 Heroku 日志中的错误:

2013-06-23T04:57:20.501850+00:00 app[worker.1]: [Worker(host:e681c9a7-c85b-4ca9-af9c-e9bea92be8f0 pid:2)] Class#send failed with Postmark::InvalidMessageError: Sender signature not defined for From address. - 2 failed attempts

这是我的邮件。

class UserMailer < ActionMailer::Base
  default from: "postman@writeonpure.com"
  ...
end

这是邮戳中定义的我的发件人签名。

这是 application.rb:

# Postmark
config.action_mailer.delivery_method = :postmark
config.action_mailer.postmark_settings = { :api_key => ENV["POSTMARK_API_KEY"] }

事情是……邮件是在开发阶段发送的,而不是在暂存阶段发送的。

【问题讨论】:

  • 能否请您在受影响的环境中启动一个 Rails 控制台,看看ActionMailer::Base.postmark_settings 是否返回与您在项目根目录中执行$ heroku config:get POSTMARK_API_KEY 时相同的键?

标签: ruby-on-rails email postmark


【解决方案1】:

我必须将config/initializers.devise.rb 中的config.mailer_sender 设置为该电子邮件地址,这样就可以了

【讨论】:

    【解决方案2】:

    是的,我遇到了同样的问题。我们需要在config/initializers.devise.rb 中设置config.mailer_sender,其中config.mailer_sender 值是您在邮戳发件人签名中使用的电子邮件

    【讨论】:

    • @jonnus,谢谢,谢谢你帮我纠正拼写错误,我是英文菜鸟^_^
    猜你喜欢
    • 2019-07-07
    • 2012-01-22
    • 2014-03-04
    • 1970-01-01
    • 2016-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-29
    相关资源
    最近更新 更多