D
D
Dmitry2016-03-03 19:45:46
Ruby on Rails
Dmitry, 2016-03-03 19:45:46

How to make sidekiq_mailer's attempts successful?

I'm trying to use sidekiq_mailer to send emails in the background...
Everything gets stuck on sidekiq's attempt to complete the task
e430cb5d818c4febb22fc28494cdb5d3.png
, it says ArgumentError: wrong number of arguments (0 for 2..3) although it itself shows all the arguments: "RemindMailer", "test", []
sidekiq-4.1.0
sidekiq_mailer-0.0.8

app/controllers/service_controller.rb:

class ServiceController < ApplicationController
    def home
        RemindMailer.test().deliver
    end
end

app/mailers/remind_mailer.rb:
class RemindMailer < ApplicationMailer
    include Sidekiq::Mailer
 
    def test()
        mail(to: "[email protected]", subject: "XXX", body: "XXX", content_type: "text/html")
    end
end

Well, OK, but if you make the mailer function accepting parameters, then like this:
8c9f0a24a4374b69893b63a154e5a227.png
Damn, and if there are two parameters, then apparently it takes the "test" mailer function for some of its own function?
1bc17de9a2d842939ea81362696ca0e6.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikiforov, 2016-03-03
@svetozar

Try another method, not test.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question