【问题标题】:How to send async emails with mail_form gem and sidekiq? [duplicate]如何使用 mail_form gem 和 sidekiq 发送异步电子邮件? [复制]
【发布时间】:2015-07-22 01:15:24
【问题描述】:

我正在使用 mail_form gem 并有以下代码

 def create
    @contact = Contact.new(contact_params)
    @contact.request = request
    respond_to do |format|
      if @contact.deliver
        format.html { redirect_to root_path, notice: "Thank you for your message."}
      else
        format.html {render :new, error: "There was a problem with sending your message."}
      end
    end
  end

当我提交联系表单时,需要几秒钟来发送消息并重定向到主页。

如何使用 sidekiq 使这个过程异步?

【问题讨论】:

标签: ruby-on-rails ruby sidekiq mail-form


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-25
    • 1970-01-01
    • 2015-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-13
    相关资源
    最近更新 更多