Note that there are some explanatory texts on larger screens.

plurals
  1. POdelayed_job send email with wrong sender on production
    primarykey
    data
    text
    <p>I working on rails 3.1.3 and use delayed_job 3.0.1</p> <p>I have found some thing wrong with email with in valid email sender.</p> <p>First I setting ActionMailer to work with Gmail <code>(xxx.gmail.com)</code> and it work fine.</p> <p>After I deploy on production server for a while. </p> <p>I have setting new ActionMailer to work with my mail server.</p> <p>And tested it on development. Then I deploy code to production server. It work fine too. </p> <p><strong>BUT sometimes email sent to client by use my old Gmail <code>(xxx.gmail.com)</code> as sender. (Sent correctly with no error)</strong></p> <p>PS. I use rails_config gem for keep email settings.</p> <p>I have try to debug that for 2 day with on luck.</p> <ul> <li>print <code>Settings.mail_sender</code> inside rails console on production server many times. it return correctly ("no-reply" )</li> <li>restart the delayed_job.</li> <li>restart server.</li> <li>try to put the sender into log. (it write to log when the sender is not a Gmail).</li> <li>check on my project there where not any gmail setting or in database.</li> </ul> <p>There is my code</p> <pre class="lang-rb prettyprint-override"><code># config/settings/production.yml mail_sender: '"no-reply" &lt;no-reply@myapp.com&gt;' # MyMailer.rb default :from =&gt; Settings.mail_sender def greeting(receiver) @receiver = receiver Delayed::Worker.logger.info "-------In inform client" Delayed::Worker.logger.info "========inform client from #{Settings.mail_sender}" mail(:to =&gt; "#{receiver.full_name} &lt;#{receiver.email}&gt;", :subject =&gt; "Hello") do |format| format.html end Delayed::Worker.logger.info inspect end # code I call the delayed_job MyMailer.delay.greeting(client) if client.can_receive_email? </code></pre> <p>Any Idea? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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