Note that there are some explanatory texts on larger screens.

plurals
  1. PODelayed_job not sending Rails 3 emails
    text
    copied!<p>Note: Using Rails 3.1 and current delayed_job gem. </p> <p>I have a <code>User</code> model that calls <code>after_create :mail_confirmation</code>.</p> <p>The <code>mail_confirmation</code> method looks like the following, per the delayed_job instructions:</p> <pre><code>def mail_confirmation UserMailer.delay.registration_confirmation(self) end </code></pre> <p>The <code>UserMailer</code> is:</p> <pre><code>class UserMailer &lt; ActionMailer::Base default from: "test@mysite.com" def registration_confirmation(user) @user = user mail(:to =&gt; "#{user.full_name} &lt;#{user.email}&gt;", :subject =&gt; "Test registration email") end end </code></pre> <p>The job is queued, and the output from <code>rake jobs:work</code> makes it seem as if it completed successfully:</p> <pre><code>[Worker(host:mymac.local pid:73694)] Starting job worker [Worker(host:mymac.local pid:73694)] Class#registration_confirmation completed after 1.3659 [Worker(host:mymac.local pid:73694)] 1 jobs processed at 0.7288 j/s, 0 failed ... </code></pre> <p>There is no error but the email is never sent. It works fine if I remove <code>delayed</code> from the method call in the <code>User</code> model and go with the standard <code>deliver</code> method:</p> <pre><code>def mail_confirmation UserMailer.registration_confirmation(self).deliver end </code></pre> <p>How can I find out what is happening when the job is processed? Any idea how to fix it?</p> <hr> <p><strong>Update</strong> It appears that it is related to this:</p> <p><a href="https://stackoverflow.com/questions/8602203/nomethoderror-with-delayed-job-collectiveidea-gem">NoMethodError with delayed_job (collectiveidea gem)</a></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