Note that there are some explanatory texts on larger screens.

plurals
  1. POsidekiq not sending mail
    text
    copied!<p>I have a functionality wherein i have to upload a large number of records from a csv file. If any one of the records is invalid, no data should be uploaded. A csv file with errors against the invalid records needs to be sent to the user who uploaded the data. I am using rails (3.2), sidekiq (2.16.1) and mysql.</p> <p>All the mails (devise and custom) mails are delivered and i receive them in my gmail inbox. The above functionality worked fine before being shifted to sidekiq. </p> <p>User model</p> <pre><code>#works n gets delivered in inbox Notifier.send_welcome_mail(self).deliver </code></pre> <p>Sidekiq Worker</p> <pre><code>class UploadWorker include Sidekiq::Worker sidekiq_options retry: false def perform(user_id, inspection_id) user = User.find(user_id) inspection = Inspection.find(inspection_id) err = false #check if all data is valid and upload if valid # ... #shows in development log but doesnt get delivered in inbox. Notifier.delay.upload_success(user, inspection) if err Notifier.delay.upload_failed(user, inspection) unless err end end </code></pre> <p>development log</p> <pre><code>Sent mail to someone@gmail.com (142ms) Date: Wed, 13 Nov 2013 17:24:25 +0530 To: someone@gmail.com Message-ID: &lt;5283687179a92_203f59f273e3@gmail.mail&gt; Subject: ["someone@gmail.com"] Upload failed Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit </code></pre> <p>sidekiq log</p> <pre><code>2013-11-13T13:21:20Z 10064 TID-1n41gu UploadWorker JID-2d2c930601caf6a62c86e142 INFO: start 2013-11-13T13:22:13Z 10064 TID-1n41gu UploadWorker JID-2d2c930601caf6a62c86e142 INFO: done: 52.858 sec 2013-11-13T13:22:13Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-bcae8ea4974ecfe280e411bd INFO: start 2013-11-13T13:22:14Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-bcae8ea4974ecfe280e411bd INFO: done: 0.858 sec 2013-11-13T13:23:51Z 10064 TID-1n41gu UploadWorker JID-03fe3dee40f6390f5cec1d93 INFO: start 2013-11-13T13:23:54Z 10064 TID-1n41gu UploadWorker JID-03fe3dee40f6390f5cec1d93 INFO: done: 2.779 sec 2013-11-13T13:23:54Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-44f75877c5919302c9ded4fe INFO: start 2013-11-13T13:23:54Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-44f75877c5919302c9ded4fe INFO: done: 0.038 sec </code></pre> <p>The issue is, only the mails from sidekiq are shown as sent in log but arent delivered. Other mails from devise n custom mail do get delivered.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload