【发布时间】:2018-07-25 20:55:34
【问题描述】:
我已经在我的 Rails 应用程序上设置了 Devise Confirmable,并且一切正常,但是当尝试将 Devise 电子邮件设置为在后台运行时,不会发送任何电子邮件。
gem 'devise', '~> 4.3'
gem 'devise_invitable', '~> 1.7', '>= 1.7.2'
gem "sidekiq"
1) 我在本地设置和运行 Redis 和 Sidekiq(他们处理的是非设计欢迎电子邮件)。
2) 我已将此添加到我的 User.rb 模型中(设计文档 - https://github.com/plataformatec/devise#activejob-integration)
def send_devise_notification(notification, *args)
UserMailer.send(notification, self, *args).deliver_later
end
在日志中似乎触发了作业,但没有发送任何内容。
[ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 01f432e9-e8cf-47fa-
b5ac-de936aa920d1) to Sidekiq(mailers) with arguments: "UserMailer",
"confirmation_instructions", "deliver_now", #<GlobalID:0x007f86f539e198 @uri=#
<URI::GID gid://experiment-log-v1/User/78>>, "wYfrsX13ie5fAFWKV8tp", {}
我也尝试在 sidekiq.yml 中添加“邮件”
:queues:
- default
- mailers
我是否为此在 ActiveJob 中遗漏了什么?如果是这样,我会放什么来覆盖所有设计电子邮件?
【问题讨论】:
标签: ruby-on-rails email devise background-process sidekiq