简体   繁体   English

Sidekiq延迟邮件程序不发送电子邮件

[英]Sidekiq Delayed Mailer not sending emails

Good afternoon, 下午好,

I'm trying to use Sidekiq/Redis to send emails in the background. 我正在尝试使用Sidekiq / Redis在后台发送电子邮件。 I should note the following: 我应该注意以下几点:

  1. I am using devise-async and it works with no issues 我正在使用devise-async ,它没有问题

  2. My ActionMailer settings are good 我的ActionMailer设置很好
    If I change my mailer calls to UserMailer.contact_email(name).deliver! 如果我更改了邮件发送程序,请致电UserMailer.contact_email(name).deliver! The email sends just fine. 电子邮件发送正常。 What is not working is UserMailer.delay.contact_email(name) 不起作用的是UserMailer.delay.contact_email(name)

  3. I can see the jobs going through in my logs, and you'd even go so far as to assume the mails were making it through. 我可以在日志中看到正在处理的工作,甚至可以认为邮件已经通过了。 It was only when I sent to myself that I noticed it wasn't working: 直到我发给自己的时候,我才发现它不起作用:
    Apr 08 18:36:58 app01-production sidekiq: 2013-04-09T00:36:58Z 31155 TID-1jdwoq Sidekiq::Extensions::DelayedClass JID-6143790ebbf6e8bbc4a7bb85 INFO: done: 4.923 sec

It is obviously calling the DelayedClass extension on the mail object, but no-go. 很明显,它在邮件对象上调用了DelayedClass扩展,但没有成功。 Given that devise-async works, I'm wondering if I am using the wrong syntax or something?` 鉴于devise-async工作原理,我想知道我使用的是错误的语法还是什么?

Thanks!! 谢谢!!

Actually i have same problem when use rails 4 version. 其实我在使用Rails 4版本时有同样的问题。 The solution above not working for me, i have check @benjamin repo and can't found it . 上面的解决方案对我不起作用,我已经检查了@benjamin repo并找不到它。 So, i have try sidekiq mailer gem https://github.com/andersondias/sidekiq_mailer and get it work well! 因此,我尝试使用sidekiq mailer gem https://github.com/andersondias/sidekiq_mailer并使其正常工作!

I hit into a similar issue too. 我也遇到了类似的问题。 I made a tiny change in the way the delayed extension calls #deliver. 我对延迟的扩展程序调用#deliver的方式进行了微小的更改。

Try this out: gem 'sidekiq', :git => "git@bitbucket.org:benjamintanweihao/sidekiq.git" . 试试看: gem 'sidekiq', :git => "git@bitbucket.org:benjamintanweihao/sidekiq.git"

If this works out for you, then it might due to msg.from not being set. 如果对您来说msg.from ,则可能是由于未设置msg.from

The relevant code is here . 相关代码在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM